Repository navigation
CxODEV-2125: keep the Kafka cancellation consumer running after a bad message (3.10.1 backport) - #230
Closed
milansvitlica-codaxy wants to merge 1 commit into
Closed
milansvitlica-codaxy wants to merge 1 commit into
milansvitlica-codaxy wants to merge 1 commit into
Conversation
…0.1 backport) The consume loop sat inside a single try/catch. When one message failed, the catch logged "will retry to consume after 5 seconds", waited, and then ExecuteAsync returned. The consumer never restarted, so the worker kept running but stopped cancelling tasks until the process restarted. Two kinds of message trigger it: - the handler throws, e.g. a status event with "workflowTask": null (NullReferenceException on WorkflowTask.Type); - the value fails to deserialize (invalid or empty JSON, an unknown status, a workflowTask without name or taskReferenceName), so Consume throws a ConsumeException. Errors are now caught per message: logged, and the loop moves on to the next message. OperationCanceledException from the stopping token still ends the loop, so shutdown is unchanged. The 5-second pause is gone. It only ran once before the loop exited, and pausing on every bad message would hold up every cancellation behind it. Tests run the real consumer against librdkafka's in-process mock cluster (test.mock.num.brokers), so they need no broker or Docker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Closing without merging: not pursuing this change for now. |
milansvitlica-codaxy
deleted the
CxODEV-2125-kafka-notifier-skip-bad-messages-v3
branch
October 9, 2026 08:41
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.
Backport of #229 to
v3.Same change: the Kafka cancellation consumer now logs and skips a message that fails, instead of stopping for good. See #229 for the problem, the fix and the tests.
ConductorSharp.Toolkitstays at 3.0.1-beta3, as onv3.Tests
Full suite on this branch,
dotnet test ConductorSharp.sln: 73 passed, 0 failed, including the three newKafkaCancellationNotifierTests. Run locally in an LF checkout on the .NET 8 runtime (DOTNET_ROLL_FORWARD=Major).CI does not run for pull requests to
v3(dotnet.ymltriggers onmasteronly), so the local run above is the check for this branch.🤖 Generated with Claude Code