-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implement SessionResetter interface #7
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.
Can we make resyncPeriod configurable in filewatcher.go?
Yeah, but why? Do you think the filesystem will need to be checked more often than two seconds? Not sure if this is a good thing to open up to users who are likely to misinterpret its usage. |
That is true, but we may want to make it longer depending on how the secret updating strategy is configured. |
|
ok, lets leave it for now |
@@ -95,6 +96,14 @@ func (c *managedConn) IsValid() bool { | |||
return s.IsValid() | |||
} | |||
|
|||
func (c *managedConn) ResetSession(ctx context.Context) error { | |||
if c.reset { |
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.
This variable is inspected but it is set when a mutex is set; this is a race condition.
This interface allows the driver to tell database/sql when a connection needs to be discarded from the pool.
These methods in this hierarchy end up calling db.conn which requests a connection from the pool and asks the driver if a reset is needed. thus flushing the connection pool.