-
Notifications
You must be signed in to change notification settings - Fork 125
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-551650: Is the parameter cfg.KeepSessionALive
useless in HeartBeat?
#556
Comments
KeepSessionALive
useless?KeepSessionALive
useless?
KeepSessionALive
useless?KeepSessionALive
useless in HeartBeat?
Looks like params["client_keep_session_alive"] = clientKeepSessionAlive 4 hours later: time="2022-02-24T14:09:09Z" level=error msg="error: 390114: Authentication token has expired. The user must authenticate again." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:338" I also do not see the execution of This is how db is created: func Setup() {
dsn, _, err := getDSN()
if err != nil {
log.Fatal(err)
}
db, err := sql.Open("snowflake", dsn)
if err != nil {
log.Fatalf("SnowFlake setup err: %v", err)
}
err = db.Ping()
if err != nil {
log.Fatalf("SnowFlake ping err: %v", err)
}
db.SetMaxIdleConns(10)
db.SetMaxOpenConns(100)
Db = db
} |
Hi @kchojn, |
Hey @sfc-gh-wfateem , What about config attr |
Hey @kchojn, I think what we're interested in is sessionClientSessionKeepAlive, but I do agree, KeepSessionAlive doesn't look like it has much use after skimming through the code briefly. Not sure what the history is behind that portion of the code. I'll look into it a bit and ask someone else who's a bit more familiar with this codebase in case there's some cleanup that needs to happen. |
@sfc-gh-wfateem, yes, I'm good with that! Thank you. This config attr Regards! |
All right then, thanks for reaching out @kchojn! Have a good one! |
This is an attempt to prevent the Snowflake connection from becoming invalid after 4 hours as described [here](snowflakedb/gosnowflake#556). The change is inspired from [this example](https://github.com/snowflakedb/gosnowflake/blob/82aecfae87c571aa7dfe1c7542e1e48517e79ec8/cmd/keepalive/keepalive.go#L37-L53) in the github.com/snowflakedb/gosnowflake code. Fixes redpanda-data#1556.
Issue description
I was wondering why I keep getting the message
Authentication token has expired
, even if I've setKeepSessionAlive
asTrue
in the config.Analyzing the code, I see that it is not parsed and used anywhere. The
keep session alive
parameter is taken fromParams
. Also I see that heartBeat is based onparams
:Edit: I'm using dsn
Should I only use params for additional settings then?
Example code
Error log
Configuration
Driver version (or git SHA): latest
Go version: go1.17.6 linux/amd64
Server version: 6.4.1
Client OS:
The text was updated successfully, but these errors were encountered: