Skip to content

[CELEBORN-2430] Expose unexpected errors in client background threads - #3829

Open
Kalvin2077 wants to merge 2 commits into
apache:mainfrom
Kalvin2077:fix/CELEBORN-2430
Open

[CELEBORN-2430] Expose unexpected errors in client background threads#3829
Kalvin2077 wants to merge 2 commits into
apache:mainfrom
Kalvin2077:fix/CELEBORN-2430

Conversation

@Kalvin2077

@Kalvin2077 Kalvin2077 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Catch and log unexpected Throwables in client background tasks. Partition readers also propagate background failures through their existing exception channel. No recovery behavior is added.

Why are the changes needed?

ExecutorService.submit stores task failures in the returned Future. If that Future is not inspected, the failures can remain invisible. Catching only Exception also misses Errors.

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

How was this patch tested?

Added unit tests verifying that DFS and local partition readers propagate background errors, and that change- and release-partition tasks log them. The focused tests passed, including red/green verification for the manager tasks. Formatting checks also passed.

@Kalvin2077 Kalvin2077 changed the title feat: expose errors and unexpected exceptions. [CELEBORN-2430] Expose unexpected errors in client background threads Aug 26, 2026
@SteNicholas
SteNicholas requested a lite review from Copilot August 28, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make failures in Celeborn client background tasks visible by logging unexpected Throwables and ensuring partition reader background failures are surfaced to callers via existing exception pathways.

Changes:

  • Add logging for unexpected Throwables in ChangePartitionManager and ReleasePartitionManager background tasks.
  • Broaden background error handling in LocalPartitionReader and DfsPartitionReader to catch Throwable and propagate via their exception channels.
  • Add new unit tests covering background failure propagation (DFS/local readers) and verifying background task error logging (change/release partition managers).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java Catch Throwable in fetch thread and propagate non-Exception via CelebornIOException (but currently risks hanging on interrupt).
client/src/main/java/org/apache/celeborn/client/read/LocalPartitionReader.java Catch Throwable in local read task and wrap unexpected failures into CelebornIOException.
client/src/main/scala/org/apache/celeborn/client/ChangePartitionManager.scala Add Throwable logging in both scheduler and per-shuffle background execution paths.
client/src/main/scala/org/apache/celeborn/client/ReleasePartitionManager.scala Add Throwable logging for background release work to prevent silent failures.
client/src/test/java/org/apache/celeborn/client/ClientThreadErrorLoggingSuiteJ.java New tests verifying unexpected background failures are logged for change/release partition managers.
client/src/test/java/org/apache/celeborn/client/read/PartitionReaderErrorHandlingSuiteJ.java New tests verifying DFS/local partition readers propagate background failures through next().

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +116 to +120
case e: InterruptedException =>
logError(
s"Batch handle change partition for shuffle $shuffleId interrupted.",
e)
throw e

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.

Rethrowing InterruptedException already terminates the task, so interruption is not being suppressed. submit records the exceptional completion in its FutureTask; restoring the flag is needed when the exception is swallowed or converted, not when it is propagated.

Comment on lines +287 to +290
} catch (InterruptedException e) {
// cancel a task for speculative, ignore this exception
logger.warn("Read thread is interrupted.", e);
} catch (Throwable t) {

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.

Fixed. Set flag for CELEBORN-2154. Remove wrong comment.

@RexXiong RexXiong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Kalvin2077

Copy link
Copy Markdown
Contributor Author

@zaynt4606 @SteNicholas
Ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants