-
Notifications
You must be signed in to change notification settings - Fork 116
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
SNOW-209092 Skip Session Close #354
Conversation
My concern with using |
Also this is a pretty big behavior change for existing users of the driver that are turning off keep alive. Their sessions will stay open on the GS side. |
I was thinking that users already enable the |
Seems we don't have end to end test for this session persistence change for go driver. Should we have one? |
Problem is that Close() does more than just optionally close the snowflake session. Go's SQL interface uses it to clean up resources (eg: open channels, etc) that it uses to manage the query lifecycle. The user must call Close() when using the driver in long running processes. So the following scenario would create a resource leak:
|
c342eb5
to
6d4a132
Compare
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.
👍
connection.go
Outdated
if err != nil { | ||
logger.Error(err) | ||
if !sc.cfg.KeepSessionAlive { | ||
err = sc.rest.FuncCloseSession(context.TODO(), sc.rest, sc.rest.RequestTimeout) |
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.
context.Todo()
or should this be sc.ctx
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.
lgtm with 1 ctx change
dc57405
to
bf76890
Compare
* enable session active when calling close() * add unit test
* enable session active when calling close() * add unit test
Description
Added a control flow to keep client session alive if parameter enabled.
Checklist
make fmt
to fix inconsistent formatsmake lint
to get lint errors and fix all of them