Skip to content

Keep sending event processor info after a failure - #534

Merged
MGathier merged 2 commits into
mainfrom
fix/processor-info-scheduler-stops-on-exception
Nov 20, 2026
Merged

MGathier merged 2 commits into
mainfrom
fix/processor-info-scheduler-stops-on-exception

Conversation

@MGathier

Copy link
Copy Markdown
Contributor

Problem

ControlChannelImpl.sendScheduledProcessorInfo() reschedules itself as its last statement. If building or sending the info of any processor throws, for example:

  • the framework-side Supplier<EventProcessorInfo> throws while collecting segment/token status, or
  • onNext throws IllegalStateException ("call was half-closed" / "call was cancelled") because a reconnect completed the outbound stream between the isReady() check and the send,

then the reschedule is skipped and the exception disappears into the unobserved ScheduledFuture. Nothing is logged. infoSupplierActive stays true, so registering another processor doesn't restart the task either.

The client keeps its connection, heartbeats, commands and queries working, but stops reporting event processor status for that context until the application restarts. In Axon Server the processors of those clients disappear from the processor overview.

We saw this in the field: a heap dump of Axon Server showed several applications connected and known to the server, with no event processor info at all.

Fix

  • Reschedule in a finally block, so the loop always continues.
  • Contain failures per processor: a failing supplier or send no longer prevents the info of the other processors from being sent.
  • Log failures at WARN, including the processor name and context.

Tests

New ControlChannelImplProcessorInfoTest (a unit test with a mocked ClientCall, no Docker needed):

Test Without the fix
processorInfoIsStillSentAfterSupplierThrowsException fails: no info sent after the failure
processorInfoIsStillSentAfterSendingFails fails: no info sent after the failure
failingSupplierDoesNotBlockInfoOfOtherProcessors fails: the healthy processor stops too

All unit tests (!*IntegrationTest) pass locally: 218 run, 0 failures. Integration tests were not run locally.

Note for review

A supplier that keeps failing now logs a WARN with a stack trace on every update interval (default 2 s). I chose visibility over silence; happy to change this to log only the first failure in a row if you'd rather keep it quiet.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BZwTrgqKzmmVjJ8cntDa1R

The scheduled task that sends event processor info rescheduled itself as
its last statement. When building or sending the info of any processor
threw an exception, the reschedule was skipped and the exception was
swallowed by the ScheduledFuture. Because infoSupplierActive stayed true,
registering a processor did not restart the task either. As a result the
client silently stopped reporting processor status for that context until
the application was restarted, while staying connected.

Always reschedule in a finally block, and contain failures per processor
so a failing supplier or send does not block the info of other processors.
Failures are logged at WARN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BZwTrgqKzmmVjJ8cntDa1R
@MGathier
MGathier requested a review from a team as a code owner November 20, 2026 06:08
@MGathier
MGathier requested review from a team, MateuszNaKodach, hjohn, m1l4n54v1c, schananas, smcvb and trimoq and removed request for a team and m1l4n54v1c November 20, 2026 06:08
@MGathier MGathier self-assigned this Nov 20, 2026

@smcvb smcvb 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.

One test curiosity. Other than that, this looks good to me.

.count();
}

private static void awaitUntil(BooleanSupplier condition) {

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.

Curious: why not use awaitility instead for this?

@smcvb

smcvb commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

We shouldn't forget to backport this to the connector-2026.1.x branch, since the fix targets main right now! I have adjusted the milestone accordingly.

Replace the hand-written awaitUntil polling helper with Awaitility and
add it as a test dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BZwTrkRHzpYUvni9BgWFew
@MGathier
MGathier merged commit dfae936 into main Nov 20, 2026
4 checks passed
@MGathier
MGathier deleted the fix/processor-info-scheduler-stops-on-exception branch November 20, 2026 12:56
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.

2 participants