Repository navigation
fix(embed): shorten test unix socket paths - #33111
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? |
|
This pull request is merged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: e730e3ddbb5b5acd3d94fe4cb7bfa44ea2f10fdf
Assessment: request_changes
The short socket path fixes embedded test startup under a long GOTMPDIR. The non-testing branch also changes path resolution for valid data directories that traverse a symlink before .., moving the socket away from the existing endpoint.
Model: gpt-6.2-sol / xhigh
Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3
- P3
pkg/embed/cluster.go:514: Start a non-testing cluster withWithDataPath("/tmp/example/link/../data")wherelinkpoints toactual/child.
Impact:filepath.Joinremoveslink/..before the filesystem resolves the symlink. The socket moves fromactual/data/mysql0.socktodata/mysql0.sock, so clients using the existing endpoint cannot connect.
Evidence: The baseline template appends/mysql0.sockto the supplied path verbatim. The retained probe bound both rendered paths on Linux and verified they land in different directories. See path-semantics.jsonl and checks/1795457413140665539-2.json. Preserve literal path concatenation for non-testing clusters and keep the short UUID path for test mode.
Validation:
-
Private /tmp and loopback preflight passed. Verified the clean checkout, frozen patch, native input ledger and six library hashes. See verification.log and checks/1795457625760107768-2.json.
-
Both new socket tests, the dynamic CN startup test and TestMarkScanGuardSQL passed on the assigned head. See embed-focused.jsonl and checks/1795457547492499300-2.json.
-
The unchanged TestMarkScanGuardSQL failed at Unix socket bind with
bind: invalid argumentwhen both changed implementation files were overlaid with their exact base versions. See embed-baseline.jsonl and checks/1795457576115879999-2.json.
Limitations:
-
Local execution covered focused Linux tests. The full embed suite, race mode and macOS runtime were not independently verified.
-
The frozen evidence identified #33094 as related and omitted its PR discussion.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 5dc975403f32277d64ba6815706466a1bdae0924
Assessment: approve
Embedded test CNs now use short, cluster-unique Unix socket paths. Non-testing clusters preserve the configured endpoint through symlink traversal, resolving the previous review finding.
Model: gpt-6.2-sol / xhigh
Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3
Validation:
-
Private /tmp and loopback preflight passed. The checkout matched the assigned head, and all six retained native library checksums matched. See receipts 1795461184219314511-2 and 1795461184822152807-2.
-
The pkg/embed suite passed on Linux, including dynamic CN startup and the three socket regression tests. A review probe also verified that the rendered non-testing configuration bound in the symlink-resolved directory and that closing the listener removed the socket. See embed-package.jsonl and receipt 1795461716716008438-2.
-
TestMarkScanGuardSQL passed with a 114-byte data directory. The same test with the two pinned base implementation files overlaid failed at bind on the old 125-byte socket path. See long-path-sql.jsonl and long-path-base.jsonl with receipts 1795461464159462025-2 and 1795461548580826345-2.
Limitations:
-
Local runtime checks covered Linux. The existing TestRestartCN was skipped by the suite.
-
The frozen evidence identifies #33094 as a related PR. Its discussion was outside the supplied evidence.
Summary
DataDir/mysql<I>.socklayout for non-testing clusters.Root cause
t.TempDir()inheritsGOTMPDIR. A long temporary directory makes the generated<data-dir>/mysql0.sockexceed the Unix socket path limit, causing frontend startup to panic withbind: invalid argument. This is shared embedded-test infrastructure behavior, not a regression specific to #33094.Related: #33094
Validation
b757475d7582c14e85defa0c2c00ad119dce444awith a 141-characterGOTMPDIR.TestMarkScanGuardSQLregression passes after the fix.pkg/embedpackage: PASS (199.395s), including multi-CN andStartNewCNServicetests.go vet ./pkg/embed: PASS.