-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix connection leak caused by rapid context cancellation #1024
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
Conversation
Fix connection leak caused by rapid context cancellation (go-sql-driver#1023)
Regression test for go-sql-driver#1023.
fix go vet warning for possibly-unused cancel (go-sql-driver#1023)
I digged into the code, from context godoc
|
I can not understand your question. Please elaborate.
What? There is no
What is "the Background context"? I can not find background context in this pull request. Do you know you can paste permalink of the code? |
Lines 595 to 598 in 15462c1
above code, if the return value is an error, It must from L597 but the ctx here is from Connect, which is a BackgoudContext, when would the backgroudcontext's Err() is not nil ? since there's no any cancel() calls to a backgroud context. Lines 67 to 72 in 15462c1
Lines 75 to 82 in 15462c1
maybe, I mistook something |
Why do you think it is a BackgroundContext? Lines 75 to 82 in 15462c1
This is an legacy API which is designed before context era. |
@methane thx for your pantience. Finally, I found the gate... |
Fix connection leak caused by rapid context cancellation (#1023)
Description
This change fixes a connection leak when the context is canceled shortly after a net.Conn is created.
Checklist