Skip to content

Isolate exceptions in processTrackQueueInParallel/flushQueueInParallel#77

Open
mliem2k wants to merge 1 commit into
MultiPaper:ver/26.2from
mliem2k:fix/parallel-tick-exception-handling
Open

Isolate exceptions in processTrackQueueInParallel/flushQueueInParallel#77
mliem2k wants to merge 1 commit into
MultiPaper:ver/26.2from
mliem2k:fix/parallel-tick-exception-handling

Conversation

@mliem2k

@mliem2k mliem2k commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Found while investigating #49 (unrelated, reporting separately since it's a distinct bug).

tickRegion() isolates any exception to the single failing region: it logs and calls moonrise\$setChunkSystemCrash(...), letting the rest of the tick continue. processTrackQueueInParallel() and flushQueueInParallel(), one method away in the same file, have no .exceptionally() at all.

Traced the future chain up through ServerChunkCache.tick() -> ServerLevel.tickAsync() -> MinecraftServer's per-level future.join() (unguarded by any try/catch at that point). An exception thrown here, e.g. from a plugin's buggy tracked-entity hook, or from flushing a broken connection, isn't silently dropped: it propagates uncaught through join() and crashes the entire tick loop, a much larger blast radius than the per-region isolation tickRegion() already provides.

This adds matching .exceptionally() handlers to both methods so a failure here degrades the same way tickRegion()'s does instead of taking the whole server down.

Test plan

  • Builds cleanly (./gradlew :shreddedpaper-server:compileJava)

Unlike tickRegion, which logs and marks a chunk-system crash on any
exception (isolating the failure to a single region), the parallel
tracked-entity and packet-flush futures had no .exceptionally() at
all. Tracing the future chain up through ServerChunkCache.tick ->
ServerLevel.tickAsync -> MinecraftServer's unguarded future.join()
confirms an exception here isn't silently dropped: it propagates
uncaught and crashes the whole tick loop, a much larger blast radius
than the per-region isolation tickRegion already provides one method
away.

Add matching .exceptionally() handlers so a failure in one of these
paths degrades the same way tickRegion's does instead of taking down
the server.
Copilot AI review requested due to automatic review settings July 16, 2026 02:08

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants