Repository navigation
Fix TcpBootstrap root rank validation and error handling - #951
Merged
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Persistent local accept failures can trigger an unbounded retry loop with CPU and warning floods, while the undersized-message test does not detect regressions that accept complete short frames.
2 open issues
What changed in this PR
This PR hardens TCP bootstrap against malformed peer check-ins and improves root-thread shutdown ordering.
Changes:
- Zero-initialize peer metadata, validate rank bounds, and require exact message sizes.
- Ignore invalid check-in connections and join the root thread before releasing its listening socket.
- Add a multi-process test covering malformed messages and invalid ranks.
| File | Description |
|---|---|
test/mp_unit/bootstrap_tests.cc |
Adds invalid peer check-in coverage followed by normal bootstrap verification. |
src/core/bootstrap/bootstrap.cc |
Strengthens input validation, connection error handling, and shutdown ordering; corrects license-header capitalization. |
Review effort: Balanced
Follow-up to #951, based on `binyli/bootstrap`. This minimal change migrates `bootstrap.cc` from `debug.h` to `logger.hpp`, maps legacy `TRACE` diagnostics to `DEBUG(NET, ...)`, and routes `Error` throws through `THROW(NET, ...)`. Bootstrap flow and `ErrorCode` values are preserved; `THROW` adds logger metadata to thrown error messages. Validation completed: clang-format, diff whitespace, logger-macro syntax, and patch applicability checks. Full build and bootstrap tests were not run because no `nvcc`, `hipcc`, or CUDA runtime headers are available; GPU execution was not authorized.
Propagate local accept failures while tolerating peer disconnects. Exercise complete undersized frames and preserve bootstrap diagnostic text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 860254af-2a4e-4a97-a421-5ff6253c442f
Changho Hwang (chhwang)
approved these changes
Nov 7, 2026
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
ExtInfo.rankis within[0, nRanks_)and zero-initializeExtInfoinTcpBootstrap::Impl::getRemoteAddresses.TcpBootstrap::Impl::netRecv.TcpBootstrap::Impl::bootstrapRootso transient or malformed connections do not abort the root thread.rootThread_before resettinglistenSockRoot_inTcpBootstrap::Impl::close.BootstrapTest.RejectInvalidRemoteAddressesunit test.