CASSSIDECAR-452: Avoid blocking the event loop in CdcPublisher event-bus handler#345
Open
Klose6 wants to merge 5 commits into
Open
CASSSIDECAR-452: Avoid blocking the event loop in CdcPublisher event-bus handler#345Klose6 wants to merge 5 commits into
Klose6 wants to merge 5 commits into
Conversation
skoppu22
reviewed
May 19, 2026
skoppu22
reviewed
May 19, 2026
skoppu22
reviewed
May 21, 2026
skoppu22
approved these changes
May 21, 2026
Author
|
Hi @yifan-c could you also take a look of this PR when you got a chance(since it needs another approval)? thank you! |
yifan-c
reviewed
May 22, 2026
Comment on lines
+176
to
+181
| private void handleAsyncFailure(String address, Throwable t) | ||
| { | ||
| LOGGER.error("Unexpected error while processing event '{}' on worker pool", address, t); | ||
| sidecarCdcStats.captureUnrecoverableCdcError(t); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
I do not think the method will be invoked, since the restart & stop methods does not re-throw exception. I am fine with keeping the method.
yifan-c
approved these changes
May 22, 2026
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.
CdcPublisher subscribes to several event-bus addresses (token-range changed, range gained/lost, server stop, CDC cache warmed up) via vertx.eventBus().localConsumer(), so handle(Message) runs on the event loop. The four range/stop branches previously called handleTokenRangeChange / handleRangeGained / handleRangeLost / stop
synchronously, all of which transitively perform blocking work(closing the Kafka producer, stopping SidecarCdc consumers, querying virtual tables). This blocks the event loop and can starve other Vert.x consumers under topology churn.
Dispatch those four branches to the shared worker pool via executorPools.executeBlocking(), matching the existing
ConfigChangedHandler pattern. Keep ON_CDC_CACHE_WARMED_UP on the event loop since it is only a single volatile write. Drop the now-redundant synchronized from handle() (event-loop-dispatched consumers cannot race with themselves; the actual handler methods remain synchronized).