Repository navigation
fix(frontend): preserve buffered TLS handshake bytes - #29996
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Reviewed head Recommendation: approve from the code-review perspective, subject to required CI passing. No confirmed blocker in the buffered TLS handoff.
Fresh exact-head validation with linked CGo:
The allocator assertion checks the repository connection buffers, not zero Go-heap retention. Temporary copied-prefix allocation is bounded by unread frontend buffer size. Local validation exercised the real TLS/packet handoff but not complete MOServer authentication or the native application replay from #29928. A durable post-UseConn MySQL framing regression would complement the current raw decrypted-payload assertion; this is non-blocking. Current preflight passed, but build/UT/SCA/coverage and Connector/J E2E were still queued/running at posting time. Merge should wait for required CI. No full frontend suite, race build or distributed replay was run locally. Ordinary PR comment only; no formal review state changed. |
|
mo-bot review · Commit: Assessment: request_changes Reviewed the complete three-file delta, frozen comments, and affected connection lifecycle. The buffered TLS handoff fixes lost handshake bytes, but disables disconnect-triggered query cancellation for connections using the new wrapper. Model: Session:
Validation:
Limitations:
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 9ae4fe7886c3f7d5a4792ce5e427517e85e26e1c
Assessment: request_changes
Reviewed the complete three-file delta, frozen comments, and affected connection lifecycle. The buffered TLS handoff fixes lost handshake bytes, but disables disconnect-triggered query cancellation for connections using the new wrapper.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0
- P2
pkg/frontend/mysql_buffer.go:379: On Linux/Darwin, a client coalesces SSLRequest and ClientHello, completes authentication, starts a long-running query, then disconnects.
Impact: bufferedNetConn hides the underlying socket's syscall.Conn interface. The refreshed liveness probe consequently reports the disconnected connection as live, so its query continues until completion, another timeout, or explicit cancellation, retaining execution and transaction resources. Preserve socket access across the wrapper and add a TCP disconnect-after-upgrade regression.
Evidence: Both server TLS branches install the wrapped connection through UseConn, which recreates livenessProbe (mysql_buffer.go:399-401). newSocketLivenessProbe unwraps only tls.Conn before asserting syscall.Conn (socket_liveness_unix.go:49-54); bufferedNetConn fails that assertion, leaving rawConn nil. The probe then always returns false,nil (lines 73-74), and routine_manager.go:235-250 skips beginClose. A standalone TCP probe using the verbatim wrapper confirmed that syscall.Conn remains hidden after the prefix drains, while the underlying socket returns EOF. Artifact: attempt-1/liveness-probe/result.log.
Validation:
-
Completed static review of buffer ownership, both handshake branches, timeout/error cleanup, callers, disconnect monitoring, compatibility, bounded costs, and all added tests.
-
Reused exact-head author evidence in comment 6120399544: linked-CGo targeted tests and TLS 1.2/1.3 coalesced handshake tests followed by UseConn, framed Conn.Read, and allocator checks.
-
Frozen exact-head CI reports successful build, Ubuntu UT, Linux SCA, coverage, Connector/J E2E, proxy BVT, and pessimistic multi-CN BVT.
-
Standalone TCP interface probe passed with Go 1.25.5 and CGO disabled. Diff whitespace and Go formatting checks passed; pinned source remained unchanged. Detailed audit saved in attempt-1/review-audit.json.
Limitations:
-
The standalone probe verifies the interface failure; it does not execute MOServer authentication or SQL cancellation. No local MatrixOne native suite was rerun.
-
The frozen bundle omits issue #29928's body and original native-client reproduction, limiting verification of the issue's full behavioral contract.
-
Performance costs were assessed structurally; no benchmark was run.
|
已修复 reviewer 指出的 TLS 升级后断开探测问题。 改动:
提交: |
109ee28 to
b042a34
Compare
|
静态检查修正已一并推送: |
|
Re-reviewed current head Recommendation: approve from the code-review perspective, subject to required CI passing. The syscall.Conn/disconnect-probe P2 raised by XuPeng-SH is addressed on this head; no new confirmed blocker. The old wrapper did hide socket access. My earlier handshake/framed-read validation did not cover that lifecycle and was insufficient to exclude the regression. The current Fresh exact-head validation with linked CGo,
I traced the repaired probe into RoutineManager's long-running-request path, where a detected closure invokes Current-head preflight passed, while owning build/UT/SCA/coverage and Connector/J checks are not yet all complete. Merge should wait for required CI. This ordinary comment does not dismiss XuPeng-SH's formal review or submit a formal approval. |
|
mo-bot review · Commit: Assessment: approve Reviewed the complete four-file delta and frozen comments. The shared TLS handoff preserves buffered bytes, and SyscallConn forwarding resolves the previous disconnect-monitor regression. No actionable findings remain. Model: Session: Validation:
Limitations:
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: b042a34d5ca0afd3cc7410b04df1cd5b3c5a74e3
Assessment: approve
Reviewed the complete four-file delta and frozen comments. The shared TLS handoff preserves buffered bytes, and SyscallConn forwarding resolves the previous disconnect-monitor regression. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0
Validation:
-
Traced both handshake branches, buffer ownership, decrypted packet continuation, timeout/error cleanup, and disconnect detection through RoutineManager.beginClose.
-
Reused exact-head evidence in comment 6126303169: linked-CGo focused tests passed with count=3, including TCP disconnect after buffered TLS upgrade; TLS 1.2/1.3 probes also passed UseConn, framed Conn.Read, and allocator checks.
-
Frozen current-head CI records successful build, Ubuntu UT, SCA, coverage, Connector/J, proxy BVT, and pessimistic multi-CN BVT.
-
Local formatting and diff whitespace checks passed. HEAD and merge-base match; source remains clean. Audit saved in attempt-1/review-audit.json.
Limitations:
-
The frozen bundle omits issue #29928's body and original client reproducer; this assessment covers the described coalesced TLS handoff and affected lifecycle.
-
No local native suite or full authentication/long-query/disconnect replay was repeated. Reused behavioral evidence covers frontend connection and socket-probe boundaries; raw CI logs were not supplied.
-
Performance was assessed structurally, without benchmarks. Buffered upgrades add one bounded copy; its backing allocation may remain until connection reclamation.
Merge Queue Status
This pull request spent 3 hours 12 minutes 30 seconds in the queue, with no time running CI. ReasonPull request #29996 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
…32748) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #29928. Release-branch follow-up to #29996; discovered while qualifying SDK #32671. ## What this PR does / why we need it: On the actual `v4.2.8-hotfix` branch, the MySQL reader can consume SSLRequest and TLS ClientHello together. Upgrading the raw socket then loses the buffered TLS bytes, causing a pre-authentication hang or EOF. Preserve that prefix at both TLS handoffs while forwarding the original socket, deadlines and close/liveness operations. This is the complete four-file backport of #29996, cherry-picked from `2bc83b0b9a2` onto release base `c66030006fc`. It adds no client retry, TLS fallback, catalog change or runner. Validation on Linux/amd64, Go 1.26.4: all nine focused TLS/disconnect roots pass normally and under race; the complete frontend package, gofmt, go vet and incremental golangci-lint pass. An independent real-service probe sends SSLRequest and ClientHello in a single write, negotiates verified TLS 1.3 and authenticates `SELECT 1` successfully. Source candidate identity is `8.0.30-MatrixOne-v4.2.8-hotfix`, git `dbd8358db62`, binary SHA-256 `e16a080574bcc8a8ef7d3ddcaa990f0a86a45ce64a295023309f471261ae2688`. This source candidate does not change the immutable published `v4.2.8-hotfix-20261114` asset. That published binary still reproduces the failure. Full SDK qualification and its distinct release/main identities are tracked in #32671; no published release or production deployment is performed here. Complete SDK qualification against this actual release-branch build now passes 1298/1298 online and 340/340 analytics cases with zero failures/errors/skips. All required TLS, certificate/hostname rejection and original Chinese-search assertions remain active. See #32671 for the separate SDK hotfix-version fixes and immutable-release counterevidence. Co-authored-by: davis zhen <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
) - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring issue matrixorigin#29928 Preserve bytes read ahead of the MySQL SSLRequest when upgrading to TLS. The TLS handoff now drains unread frontend buffer bytes before reading the underlying connection, and both handshake branches use the handoff. Added a real coalesced ClientHello TLS regression and post-handshake payload check. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 2f43dee)
What type of PR is this?
Which issue(s) this PR fixes:
issue #29928
What this PR does / why we need it:
Preserve bytes read ahead of the MySQL SSLRequest when upgrading to TLS. The TLS handoff now drains unread frontend buffer bytes before reading the underlying connection, and both handshake branches use the handoff. Added a real coalesced ClientHello TLS regression and post-handshake payload check.