complete pending uring TCP connects#1375
Open
russellromney wants to merge 2 commits into
Open
Conversation
4b1b78c to
4f889cd
Compare
4f889cd to
ced4fc3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete pending uring TCP connects from a shared helper before reporting socket readiness, blocking-connect completion, or
SO_ERROR.This handles the case where a nonblocking TCP
connect()is still represented in Quark asTCPConnectingwith cached-EINPROGRESS, while the host socket has already completed the connection.This PR is stacked on #1373 because the regression also needs correct
select(2)exception-fdset clearing.What Changed
UringSocketOperations::CompletePendingConnect().Readiness()forTCPConnectingsockets.GetSockOpt(SO_ERROR)before returning cached connect state.PostConnect()idempotent, and restoreTCPIniton completed connect failure.test/c/soerror_connect_loop.c, a loopback nonblocking-connect regression that checks successful readiness,getpeername(), and refused-connectSO_ERRORclearing.Proof / Investigation
Diagnostic proof branch: https://github.com/russellromney/Quark/tree/codex/soerror-connect-proof
Tracking issue with the investigation notes: #1374
The proof branch shows the failure without Postgres, psycopg, or application code. It is just a loopback TCP listener and a nonblocking TCP client checking immediate
SO_ERROR,select()readiness, and finalSO_ERROR.Validation
Built a qkernel from this branch on the Quark repro host, rebuilt the C regressions as Linux ELF binaries and ran the standalone C loopback regression under Docker
--runtime=quark:Also reran the select regression from #1373 under the same qkernel:
And reran the minimal Postgres 18 + psycopg check: