[CELEBORN-2412] Propagate the worker error message through cpp MessageDispatcher failures - #3791
Closed
yugan95 wants to merge 1 commit into
Closed
[CELEBORN-2412] Propagate the worker error message through cpp MessageDispatcher failures#3791yugan95 wants to merge 1 commit into
yugan95 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the C++ client’s observability and failure classification by propagating worker-provided error strings through MessageDispatcher failures (instead of fulfilling promises with a blank std::exception()), and strengthens unit tests to assert on the surfaced message content.
Changes:
- Wrap
RPC_FAILUREandCHUNK_FETCH_FAILUREwithstd::runtime_errorcontaining the worker’s error message (and chunk context for fetch failures). - Strengthen
MessageDispatcherTestto assert that failure futures contain the expected error text (including a realStatusCodename substring for push failures). - Add a shared helper to extract exception messages from failed futures.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cpp/celeborn/network/MessageDispatcher.cpp | Preserve worker error text by setting promise exceptions with std::runtime_error messages for RPC and chunk-fetch failures. |
| cpp/celeborn/network/tests/MessageDispatcherTest.cpp | Add helper + tighten failure tests to validate exception message contents. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…eDispatcher failures
yew1eb
approved these changes
Aug 12, 2026
SteNicholas
pushed a commit
that referenced
this pull request
Aug 12, 2026
…eDispatcher failures ### What changes were proposed in this pull request? `MessageDispatcher::read` decodes the error string a worker sends back on `RPC_FAILURE` / `CHUNK_FETCH_FAILURE` and then throws it away — both paths fulfil the pending promise with a blank `std::exception()`: ```cpp holder.msgPromise.setException(folly::exception_wrapper(std::exception())); ``` This PR builds the exception from the message instead: - `RPC_FAILURE` → `folly::make_exception_wrapper<std::runtime_error>(failure->errorMsg())` - `CHUNK_FETCH_FAILURE` → same, using the already-formatted `errorMsg` that includes the `streamChunkSlice` context. `MessageDispatcherTest` is strengthened accordingly: a shared `takeExceptionMessage()` helper is added, the two failure tests now assert on the message content rather than merely `hasException()`, and `sendPushDataAndReceiveFailure` uses a real StatusCode name (`PUSH_DATA_FAIL_PARTITION_NOT_FOUND`) so it exercises the classification path it is meant to protect. ### Why are the changes needed? `ShuffleClientImpl::getPushDataFailCause` classifies a push failure by matching StatusCode names as substrings of the error message, and `PushDataCallback::onFailure` / `PushMergedDataCallback` feed it `exception->what()`. With a blank `std::exception`, `what()` is a fixed runtime string that matches none of the 13 candidate causes, so classification always falls through to `PUSH_DATA_FAIL_NON_CRITICAL_CAUSE`. Two consequences: 1. `excludeWorkerByCause` only acts on the connection-fail / timeout causes and hits its `default:` branch every time, so `celeborn.client.excludeWorker.enabled` never actually excludes a worker on the C++ push path. 2. When revive attempts are exhausted, `classifyPushFailure` raises `"PUSH_DATA_FAIL_NON_CRITICAL_CAUSE: <blank>"` — the worker's real reason (partition not found, worker excluded, replica write failure, …) is gone from the task-failure message, which makes these failures very hard to diagnose from client logs alone. Chunk fetch failures lose the worker's diagnostics the same way. This restores parity with the Java client, where `TransportResponseHandler` surfaces the worker's error text and `ShuffleClientImpl#getPushDataFailCause` can act on it. ### Does this PR resolve a correctness bug? - [ ] Yes Shuffle output is unaffected, so this is not a result-correctness bug. It is a failure-classification bug: worker exclusion never engages on the C++ push path, and the worker's reason is missing from the task-failure message. ### Does this PR introduce _any_ user-facing change? - [ ] Yes No config, API or behaviour change. Push and fetch failure messages now carry the worker's reason instead of a placeholder. ### How was this patch tested? Unit tests in `cpp/celeborn/network/tests/MessageDispatcherTest.cpp`: - `sendRpcRequestAndReceiveFailure` — asserts the RPC failure message reaches the caller. - `sendPushDataAndReceiveFailure` — asserts a StatusCode name (`PUSH_DATA_FAIL_PARTITION_NOT_FOUND`) survives on the exception, which is exactly what `getPushDataFailCause` needs to see. Covered by the `Celeborn Cpp Integration Test` workflow (`Run Unittests of Celeborn Cpp`). Closes #3791 from yugan95/CELEBORN-2412. Authored-by: Yu Gan <zhongheng.gy@alibaba-inc.com> Signed-off-by: 子懿 <programgeek@163.com>
Member
|
Merged to main(v1.0.0) and branch-0.7(v0.7.1). |
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.
What changes were proposed in this pull request?
MessageDispatcher::readdecodes the error string a worker sends back onRPC_FAILURE/CHUNK_FETCH_FAILUREand then throws it away — both paths fulfil the pending promise with a blankstd::exception():This PR builds the exception from the message instead:
RPC_FAILURE→folly::make_exception_wrapper<std::runtime_error>(failure->errorMsg())CHUNK_FETCH_FAILURE→ same, using the already-formattederrorMsgthat includes thestreamChunkSlicecontext.MessageDispatcherTestis strengthened accordingly: a sharedtakeExceptionMessage()helper is added, the two failure tests now assert on the message content rather than merelyhasException(), andsendPushDataAndReceiveFailureuses a real StatusCode name (PUSH_DATA_FAIL_PARTITION_NOT_FOUND) so it exercises the classification path it is meant to protect.Why are the changes needed?
ShuffleClientImpl::getPushDataFailCauseclassifies a push failure by matching StatusCode names as substrings of the error message, andPushDataCallback::onFailure/PushMergedDataCallbackfeed itexception->what(). With a blankstd::exception,what()is a fixed runtime string that matches none of the 13 candidate causes, so classification always falls through toPUSH_DATA_FAIL_NON_CRITICAL_CAUSE. Two consequences:excludeWorkerByCauseonly acts on the connection-fail / timeout causes and hits itsdefault:branch every time, soceleborn.client.excludeWorker.enablednever actually excludes a worker on the C++ push path.classifyPushFailureraises"PUSH_DATA_FAIL_NON_CRITICAL_CAUSE: <blank>"— the worker's real reason (partition not found, worker excluded, replica write failure, …) is gone from the task-failure message, which makes these failures very hard to diagnose from client logs alone.Chunk fetch failures lose the worker's diagnostics the same way.
This restores parity with the Java client, where
TransportResponseHandlersurfaces the worker's error text andShuffleClientImpl#getPushDataFailCausecan act on it.Does this PR resolve a correctness bug?
Shuffle output is unaffected, so this is not a result-correctness bug. It is a failure-classification bug: worker exclusion never engages on the C++ push path, and the worker's reason is missing from the task-failure message.
Does this PR introduce any user-facing change?
No config, API or behaviour change. Push and fetch failure messages now carry the worker's reason instead of a placeholder.
How was this patch tested?
Unit tests in
cpp/celeborn/network/tests/MessageDispatcherTest.cpp:sendRpcRequestAndReceiveFailure— asserts the RPC failure message reaches the caller.sendPushDataAndReceiveFailure— asserts a StatusCode name (PUSH_DATA_FAIL_PARTITION_NOT_FOUND) survives on the exception, which is exactly whatgetPushDataFailCauseneeds to see.Covered by the
Celeborn Cpp Integration Testworkflow (Run Unittests of Celeborn Cpp).