-
Notifications
You must be signed in to change notification settings - Fork 507
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
go-mssqldb does not respect context.Context #527
Comments
I think we can refer to the core |
I've reproduced the issue and I will investigate further. |
We have ureliable network between AWS eu-west-1 (Ireland) and London data-center. As result I see lond-running dead connections without which does not respect connect_timeout option (1) and context (2). I have configured context.Timeout to 10 minutes and connection timeout to 20 minutes. It happens after long (about 1 hour) inactivity. Seems like, keepalive does not work as well Fortunately, out daemons export pprof and I can dump stack-traces for that.
|
Describe the bug
For example, I expected that the following code timeouts with 100msec:
But it turns out that it timeouts not with 100msec, but with 15sec.
To Reproduce
case1
You will see connect error:
case2
Assume sql server is running at
10.20.194.53:11433
. ThenOn other terminal, execute
iptables
to drop packets to10.20.194.53:11433
:Then you see the following read error in terminal1:
Expected behavior
Timeout with 100msec
Further technical details
SQL Server version: Any
Operating system: Any
Additional context
I know that 15sec is the
dial timeout
that is optionally specified via the connect URL.My point is that go-mssqldb should respect
context.Context
per method, such as PingContext, QueryContext, ExecContext etc.The text was updated successfully, but these errors were encountered: