Repository navigation
fix(control): drop connection on write timeout - #126
bappisinsane wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Thanks for picking this up, @bappisinsane, and so quickly. The fix is in the right place. Three things before I can merge it:
-
A test. #125 asks for one that fails on
mainand passes with your change: shrinkWRITE_TIMEOUT, have a command return a large reply, connect with a smallSO_RCVBUFand don't read, then check the connection is closed after the timeout. Without it, nothing stops this coming back. -
Sign-off. The
dcocheck needs aSigned-off-by:line on the commit.git commit --amend -s --no-editand a force-push will sort it. -
A smaller change.
writer.transportalways exists on aStreamWriter, andabort()doesn't raise, so thegetattrandsuppresscan go, and so can the leftoverpass:except (ConnectionError, TimeoutError): writer.transport.abort() # drop the unsent reply now, not when the client reads
For the CHANGELOG line, say what a reader would notice, something like: "The control socket closes a connection whose client stops reading, instead of keeping it and its reply open after the write timeout (#125)."
I've approved the CI run for this commit, and I'll approve the next one when you push.
|
Addressed all three points:
On the test: I haven't yet added the write-timeout regression test; I'll follow up with it. The change itself is minimal and matches the suggested snippet. |
|
Thanks, @bappisinsane. The code change is exactly what I was after, and so is the CHANGELOG line. What's holding it up now is the branch, plus the test you already mentioned. The branch conflicts with The first commit still has no sign-off. The git reset --soft HEAD~2
git commit -s
git fetch https://github.com/jamesconwaydev/sentry-v2 main
git rebase FETCH_HEAD # fix CHANGELOG.md, git add it, git rebase --continue
git push --force-with-leaseThe test is the part I can't merge without. #125 has the recipe: shrink |
|
Thanks for the detailed guidance. I'll squash both commits with sign-off, rebase onto main, fix the CHANGELOG heading under [Unreleased], and add the write-timeout regression test per #125. Will push with --force-with-lease and ping once CI is green. |
6774995 to
0564bf1
Compare
|
Same good news here, @bappisinsane: Only the test is missing. #125 has the recipe, and |
Signed-off-by: bappisinsane <108801304+bappisinsane@users.noreply.github.com>
0564bf1 to
74844ed
Compare
|
Checking in, @bappisinsane. The fix still looks right to me, and CI is green on
If life got busy, no problem. Say the word and I'll add the test on top of your commit, with your name kept on the fix and in the release notes. Either way, #79 is still held for you. |
Fixes #125.
When a write times out, the control socket now aborts the transport so the buffered reply and the socket are dropped at once, and the per-uid connection count (released in
_handle's finally) only comes down once the connection is really gone._handleabortswriter.transportonTimeoutError/connection errors.