Skip to content

fix: Improve subscriber timeout error message with SubscriptionTimeoutException#2727

Merged
He-Pin merged 1 commit intoapache:mainfrom
He-Pin:fix-subscriber-timeout-message
Mar 15, 2026
Merged

fix: Improve subscriber timeout error message with SubscriptionTimeoutException#2727
He-Pin merged 1 commit intoapache:mainfrom
He-Pin:fix-subscriber-timeout-message

Conversation

@He-Pin
Copy link
Copy Markdown
Member

@He-Pin He-Pin commented Mar 13, 2026

Motivation

When subscriber-timeout fires in FanoutProcessorImpl, users see a generic AbruptTerminationException with no indication that the root cause is a subscription timeout. This makes debugging difficult because the error message gives no actionable information.

The CancelTermination handler was calling primaryInputs.cancel() + context.stop(self) directly, which triggers the generic AbruptStageTerminationException in downstream subscribers.

Modification

  • Changed CancelTermination handler in FanoutProcessorImpl to call fail(new SubscriptionTimeoutException(...)) instead of primaryInputs.cancel(); context.stop(self)
  • fail() already handles the full lifecycle: cancel upstream → error downstream → stop actor
  • Added a warning log before failing, making the timeout visible in logs
  • Added regression test in FanoutProcessorSpec that verifies downstream subscribers receive SubscriptionTimeoutException with an informative message

Result

Downstream subscribers now receive SubscriptionTimeoutException with a clear message like:

Publisher was not attached to upstream within deadline (300 milliseconds)

instead of the generic AbruptStageTerminationException.

References

…stead of AbruptTerminationException (apache#2645)

When subscriber-timeout fires on a FanoutProcessor with CancelTermination mode,
the actor now calls fail() with a SubscriptionTimeoutException instead of directly
calling context.stop(self). This provides a clear error message ('Subscription
timeout expired, no subscriber attached') rather than a generic
'Processor actor terminated abruptly' from AbruptTerminationException.

A warning log is also emitted when the timeout fires.

References: apache#2645

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

lgtm

@He-Pin He-Pin merged commit 73668de into apache:main Mar 15, 2026
9 checks passed
@He-Pin He-Pin deleted the fix-subscriber-timeout-message branch March 15, 2026 14:41
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.

Subscriber timeout causes a non-informative AbruptTerminationException

2 participants