-
Notifications
You must be signed in to change notification settings - Fork 1
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
backend/postgres: Various improvments #35
Conversation
@@ -5,13 +5,13 @@ go 1.18 | |||
require ( | |||
github.com/lib/pq v1.4.0 | |||
github.com/mattn/go-sqlite3 v1.13.1-0.20200416054559-98a44bcf5949 | |||
github.com/stretchr/testify v1.6.1 | |||
github.com/stretchr/testify v1.8.4 |
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.
also bump the go version ? (and in the workflow file)
} | ||
|
||
func (qce *queryCanceledError) Is(target error) bool { | ||
return target == context.Canceled |
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.
Should we fall back to a the wrapped error if the condition failed ?
return target == context.Canceled | |
if target == context.Canceled { | |
return true | |
} | |
return errors.Is(qce.cause, target) |
?
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.
it is done directly by the std lib in the implementation of errors.Is
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.
Won't we need the Unwrap method to be implemented on this type then ?
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.
Other than that lgtm
What does this PR do?
This PR packs 3 improvemnt:
lib/pq brings a new sslsni option turns on by default: lib/pq#1088. It breaks our setup with RDS CA.
if a context is canceled mid request now errors.Is(err, context.Canceled) should return tru
For CA key rotation it will be critical
What are the observable changes?
Good PR checklist
Additional Notes