-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workload: Ignore transaction restart errors. #75244
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, nice find!
// data may contain error with "restart transaction" -- skip those as well. | ||
if data != nil { | ||
ev := data["err"] | ||
if err, ok := ev.(error); ok && strings.Contains(err.Error(), "restart transaction") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you'd like, the check could be done once after formatting the message we log
i.e. check the resulting string from fmt.Sprintf("pgx logger [%s]: %s logParams=%v", level.String(), msg, data)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, I suppose; but this way it's more explicit... I'll keep it as is for now; but maybe we'll have to do this trick in the future.
bors r+ |
Canceled. |
Bors r+ |
Build failed: |
Bors r+ |
Build failed: |
bors r+ |
Build failed: |
Update pgx helpers to ignore "restart transactions" errors. Previsouly, these were sent via a "msg" portion of the Log call. It appears that these messages may also arrive in the "data". Release Notes: None
bors+ |
bors r+ |
Build failed (retrying...): |
This PR was included in a batch that was canceled, it will be automatically retried |
Build failed (retrying...): |
Build succeeded: |
Update pgx helpers to ignore "restart transactions" errors.
Previsouly, these were sent via a "msg" portion of the Log call.
It appears that these messages may also arrive in the "data".
Release Notes: None