Skip to content
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

Connection killed after ExecContext is done #66

Closed
nmaslarski opened this issue Nov 13, 2020 · 2 comments
Closed

Connection killed after ExecContext is done #66

nmaslarski opened this issue Nov 13, 2020 · 2 comments
Labels

Comments

@nmaslarski
Copy link

Hello colleagues,

I have the following situation, which I'm not sure is a bug or just me not understanding something, but it started happening with release 0.100.9

We're using the driver via the standard go sql package.
So we have a db client dbClient, err := hana.Connect(connectionConfig)
We create a prepared statement insertStmt, err := dbClient.Prepare(insertStmtSQL)
And we call ExecContext() on the prepared statement. _, err = insertStmt.ExecContext(ctx, ...)

However sometimes the ctx passed to ExecContext is being cancelled.
And we're expecting that only the current ExecContext is being cancelled. And up untill 0.100.9 our expectations were true.
However since 0.100.9 we see session.go:295: Kill session 112685822327579 in the logs.
And any further uses of the PreparedStatement (insertStmt in above snipper) and the dbClient object fail with

hdb.protocol 2020/11/13 09:09:32 session.go:138: Connection read error local address x.x.x.x:xxxxx remote address x.x.x.x:xxxxx: read tcp x.x.x.x:xxxxx->x.x.x.x:xxxxx: use of closed network connection
hdb.protocol 2020/11/13 09:09:32 session.go:154: Connection write error local address x.x.x.x:xxxxx remote address x.x.x.x:xxxxx: set tcp 1x.x.x.x:xxxxx: use of closed network connection

I traced down the issue to this particular line that's been added in 0.100.9:
https://github.com/SAP/go-hdb/blob/main/driver/connection.go#L384

@stfnmllr stfnmllr added the bug label Nov 13, 2020
@stfnmllr
Copy link
Contributor

Thanks for reporting the issue!
Please re-try with https://github.com/SAP/go-hdb/releases/tag/v0.102.5.

@nmaslarski
Copy link
Author

Works!
Thank you for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants