Make topic exists error silent in Kafka 3.0 createTopic#17767
Merged
xiangfu0 merged 1 commit intoapache:masterfrom Feb 26, 2026
Merged
Make topic exists error silent in Kafka 3.0 createTopic#17767xiangfu0 merged 1 commit intoapache:masterfrom
xiangfu0 merged 1 commit intoapache:masterfrom
Conversation
Handle TopicExistsException in KafkaServerStartable.createTopic by returning silently when the topic already exists, matching the behavior of kafka20 clients. This prevents quickstart from failing when topics like flights-realtime already exist. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #17767 +/- ##
============================================
+ Coverage 63.21% 63.23% +0.02%
Complexity 1454 1454
============================================
Files 3179 3179
Lines 191279 191282 +3
Branches 29251 29253 +2
============================================
+ Hits 120909 120952 +43
+ Misses 60930 60894 -36
+ Partials 9440 9436 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
shauryachats
approved these changes
Feb 25, 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.
Summary
Handle
TopicExistsExceptioninKafkaServerStartable.createTopicby returning silently when the topic already exists, matching the behavior of kafka20 clients.Problem
Quickstart fails with
RuntimeException: Failed to create topic: flights-realtimewhen the topic already exists (e.g., from a previous run).Solution
Catch
ExecutionExceptionwith causeTopicExistsExceptionand return silently instead of rethrowing, consistent with kafka20 behavior.Testing
KafkaServerStartableTestpassesMade with Cursor