Skip to content

test(logservice): recover bounded gossip fixture bind collisions - #30029

Merged
XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
XuPeng-SH:mo-bot/issue-29986-46ed6a1b0528
Oct 12, 2026
Merged

XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
XuPeng-SH:mo-bot/issue-29986-46ed6a1b0528

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Closes #29986

What this PR does / why we need it:

Port probes close before gossip services bind, allowing another listener to claim a selected endpoint. Bound initial construction to three attempts on verified bind collisions. Close partial cohorts and remove matching runtime registrations before regenerating endpoints and seeds. Allocation errors return partial ownership for cleanup; non-bind errors, cancellation, rollback failures and persistent collisions remain failures.

Preserve topology, convergence, replica-addition and direct same-config restart assertions. Real-listener regressions cover late-node collision, an earlier node collision and an occupied injection endpoint, retaining actual errors and verifying recovery and cleanup. Production APIs and dependencies are unchanged.

Validation used Go 1.27.1, CGo enabled and verified native libraries:

  • All three collision subtests passed normal, race and set-coverage runs without skips or race reports.
  • Formatting, whitespace, headers, go vet, configured molint and golangci-lint v2.14.0 passed for the complete delta.
  • Matching previous package/helper/caller validation, coverage and original-gossip stress evidence was reused; the changed regression was revalidated separately.
  • Independent gpt-6.1-sol/xhigh review accepted committed candidate 020b99784bd4 without material findings.

Local tests used a private mount/network namespace. Remote CI remains pending.

Closes #29986

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify mergify Bot added kind/bug Something isn't working kind/test-ci labels Oct 12, 2026
@matrix-meow matrix-meow added the size/L Denotes a PR that changes [500,999] lines label Oct 12, 2026
@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 99755b8a1bea988657fab50a505c0bcc260900ab

Assessment: request_changes

Reviewed the complete test-only delta. The bounded retry design preserves existing gossip assertions, but loses partial-cohort cleanup when a constructor panics.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

  • P2 pkg/logservice/gossip_fixture_test.go:74: After one node starts, another listener claims a later node's LogServiceListenAddr. morpc.server.Start logs Fatal on the bind failure; WithServerLogger installs a WriteThenPanic logger, so start(cfg) panics instead of returning an error.
    Impact: The helper skips rollback, and the caller has not yet registered its cleanup defer. NewService closes the failing instance, but previously started nodes and cohort runtime registrations remain live during unwinding. The old construction loop had a protecting defer. Restore deferred rollback until ownership transfers, and cover constructor panic cleanup.
    Evidence: The reachable panic path is service.go:206,227 -> common/morpc/server.go:33,187 -> logutil/api.go:161. An unchanged-source helper extraction reproduced starts=2, cleanup calls=0, earlier node closed=false. The previous deferred-owner control and returned-bind-error control passed. See attempt-1/helper-probe.log and helper-probe-provenance.json. Existing real-listener regressions inject only the gossip endpoint.

Validation:

  • Reviewed both changed files, configuration allocation, retry/cancellation/error handling, service ownership, runtime replacement protection, and retained convergence/restart assertions.

  • Frozen HEAD and clean source status verified; diff whitespace and changed-file formatting checks passed.

  • Standalone ownership probe failed the panic-cleanup invariant; both controls passed. This used the exact helper with minimal service/configuration stubs.

  • Author reports normal, race and coverage passes for all three real collision cases. Relevant fixture and constructor code is unchanged from candidate 020b997. Frozen CI remained pending.

Limitations:

  • The RPC-bind trigger was established by source tracing; native integration tests were not independently executed. Toolchain bootstrap failed, and repository provenance verification found no native stamp.

  • The linked issue body and fixture timing measurements were absent from the supplied evidence.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 99755b8a1bea988657fab50a505c0bcc260900ab

Assessment: request_changes

Reviewed the complete test-only delta. The bounded retry design preserves existing gossip assertions, but loses partial-cohort cleanup when a constructor panics.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

  • P2 pkg/logservice/gossip_fixture_test.go:74: After one node starts, another listener claims a later node's LogServiceListenAddr. morpc.server.Start logs Fatal on the bind failure; WithServerLogger installs a WriteThenPanic logger, so start(cfg) panics instead of returning an error.
    Impact: The helper skips rollback, and the caller has not yet registered its cleanup defer. NewService closes the failing instance, but previously started nodes and cohort runtime registrations remain live during unwinding. The old construction loop had a protecting defer. Restore deferred rollback until ownership transfers, and cover constructor panic cleanup.
    Evidence: The reachable panic path is service.go:206,227 -> common/morpc/server.go:33,187 -> logutil/api.go:161. An unchanged-source helper extraction reproduced starts=2, cleanup calls=0, earlier node closed=false. The previous deferred-owner control and returned-bind-error control passed. See attempt-1/helper-probe.log and helper-probe-provenance.json. Existing real-listener regressions inject only the gossip endpoint.

Validation:

  • Reviewed both changed files, configuration allocation, retry/cancellation/error handling, service ownership, runtime replacement protection, and retained convergence/restart assertions.

  • Frozen HEAD and clean source status verified; diff whitespace and changed-file formatting checks passed.

  • Standalone ownership probe failed the panic-cleanup invariant; both controls passed. This used the exact helper with minimal service/configuration stubs.

  • Author reports normal, race and coverage passes for all three real collision cases. Relevant fixture and constructor code is unchanged from candidate 020b997. Frozen CI remained pending.

Limitations:

  • The RPC-bind trigger was established by source tracing; native integration tests were not independently executed. Toolchain bootstrap failed, and repository provenance verification found no native stamp.

  • The linked issue body and fixture timing measurements were absent from the supplied evidence.

@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot work · mo-bot-local · superseded

Commit: 99755b8a1bea988657fab50a505c0bcc260900ab

new same-head PR feedback/CI evidence requires a fresh task

@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot work · mo-bot-local · failed

Commit: 99755b8a1bea988657fab50a505c0bcc260900ab

Implemented deferred rollback and panic/Goexit coverage. Package validation passed, but native execution disproved the design’s RPC-bind panic premise; R4 needs revision.

@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot work · mo-bot-local · done

Commit: 99755b8a1bea988657fab50a505c0bcc260900ab

Accepted the complete committed candidate. The repair and validation meet the design; no material blocker remains. Remote CI is pending.

Verified commit: 77f79d6; fresh CI is pending

@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 77f79d619ddb88d209d70f9de82980f66921339f

Assessment: approve

The complete test-only delta preserves gossip assertions and provides bounded startup retry with correct cohort ownership and rollback. The prior panic/Goexit cleanup concern is resolved. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-8e48-7622-ad17-b605f08450ce · slot 1 · generation 0

Validation:

  • Verified frozen HEAD, clean source and exact patch equality; reviewed all three changed files and their constructor, allocator, runtime-registry and shutdown owners.

  • Checked cancellation, exhaustion, allocation failures, cleanup failures, panic identity, Goexit and runtime replacement. Functional gossip assertions and same-config restart remain unchanged.

  • The exact source-extracted startup helper passed 100 race-enabled runs, including unwinding after an earlier failed generation, ownership transfer and exactly-once cleanup.

  • Changed-file formatting and diff whitespace checks passed.

  • Reused relevant frozen author-reported native collision, race, coverage and package/caller evidence. Checked all technical review comments against current code.

Limitations:

  • Native tests were not independently executed: retained artifacts lack a provenance stamp, and local Go is older than the repository requirement. The helper probe used minimal stubs and does not establish native constructor or socket behavior.

  • Frozen CI remains in progress. Author reports identify the final repaired commit, but detailed current-head native logs were not supplied.

  • Independent linked-issue text and before/after fixture timing measurements were unavailable.

@matrix-meow matrix-meow added size/XL Denotes a PR that changes [1000, 1999] lines and removed size/L Denotes a PR that changes [500,999] lines labels Oct 12, 2026

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 77f79d619ddb88d209d70f9de82980f66921339f

Assessment: approve

The complete test-only delta preserves gossip assertions and provides bounded startup retry with correct cohort ownership and rollback. The prior panic/Goexit cleanup concern is resolved. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-8e48-7622-ad17-b605f08450ce · slot 1 · generation 0

Validation:

  • Verified frozen HEAD, clean source and exact patch equality; reviewed all three changed files and their constructor, allocator, runtime-registry and shutdown owners.

  • Checked cancellation, exhaustion, allocation failures, cleanup failures, panic identity, Goexit and runtime replacement. Functional gossip assertions and same-config restart remain unchanged.

  • The exact source-extracted startup helper passed 100 race-enabled runs, including unwinding after an earlier failed generation, ownership transfer and exactly-once cleanup.

  • Changed-file formatting and diff whitespace checks passed.

  • Reused relevant frozen author-reported native collision, race, coverage and package/caller evidence. Checked all technical review comments against current code.

Limitations:

  • Native tests were not independently executed: retained artifacts lack a provenance stamp, and local Go is older than the repository requirement. The helper probe used minimal stubs and does not establish native constructor or socket behavior.

  • Frozen CI remains in progress. Author reports identify the final repaired commit, but detailed current-head native logs were not supplied.

  • Independent linked-issue text and before/after fixture timing measurements were unavailable.

This branch was previously deployed

1 inactive deployment
ci — 2472ef6b Deployed Oct 12, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Coverage gossip fixture intermittently encounters an occupied TCP port

2 participants