Repository navigation
Conversation
jacklin78911-collab
requested review from
alogfans,
chestnut-Q,
doujiang24 and
staryxchen
as code owners
August 20, 2026 03:05
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.
Description
This PR adds a sliding inactivity/progress deadline to TCP client sessions, addressing the case where a peer accepts a request but stops making progress while transferring the payload.
The deadline is refreshed only after an Asio completion reports real protocol or payload progress. It is controlled by
MC_TCP_PROGRESS_TIMEOUT_SECand defaults to 30 seconds.This is an inactivity/progress deadline, not an absolute transfer deadline. A slow transfer that continues making progress can run longer than
MC_TCP_PROGRESS_TIMEOUT_SEC.Once a matching progress-timeout handler executes, the timeout decision is sticky. A success I/O completion that was already ready but runs later cannot reverse the timeout into a clean successful completion.
Conversely, if real progress executes first, it advances the progress epoch, making the previously queued timer stale.
For WRITE operations, timeout failure is not reported until outstanding body I/O has quiesced, preserving the lifetime of the caller-owned source buffer. Timed-out connections are always reported as dirty and are not returned to the reusable connection pool.
Most of the diff is deterministic test coverage for timeout/I/O ordering, shutdown, and exactly-once completion behavior.
Related to #2930.
Module
mooncake-transfer-engine)Type of Change
How Has This Been Tested?
Deterministic coverage includes:
Final local validation:
tcp_write_visibility_test: 36/36 passed.tcp_write_visibility_test: 36/36 passed with leak detection enabled and no sanitizer report.clang-format --dry-run --Werror: passed.git diff --check upstream/main..HEAD: passed.Targeted tests were also exercised under TSan instrumentation during development. Test assertions passed, but TSan still reported existing project baseline races in
Transport::Slicestatus access. No new report pointed toClientSession, progress-timer ownership,progress_epoch_, or the sticky timeout state. This is not claimed as a clean TSan pass.pre-commitwas unavailable in the current local environment, so it is not claimed as passed.Scope and limitations
This PR does not change:
Checklist
clang-format --dry-run --Werror.pre-commitpassed locally — unavailable in the current environment.AI Assistance Disclosure
Codex assisted with implementation review, deterministic race-test design, local validation, and preparation of the PR description. The human submitter remains responsible for reviewing and understanding every changed line.