-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve experience with serialization errors
serialization errors are not well handled in the postgres datastore: - they tend to be logged by the pgx driver with potentially very large SQL statements - they are not retried - they return to the client as unknown instead of the recommended aborted gRPC code - no information is logged on retries in Debug level Serialization can also manifest as a transaction rollback, and so code is added to retry and wrap the error accordingly so gRPC Aborted is returned. Additionally, retries after serialization can lead to longer requests, and longer requests can hit the deadline. Sometimes a cancellation leads to the pgx connection to be asynchronously closed, loosing information about the original cause it was closed. Unfortunately there isn't an exported type for this, so it's detected via the string. The error is turned into a multi error that has cancellation. In a local load-test, evidence shows that in all cases the original reason was cancellation. A call to pgx.SafeToRetry is added to handle various pgx internal errors (like "conn closed") and determine if they can be retried.
- Loading branch information
1 parent
9fe5986
commit f6c25f5
Showing
4 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters