fix: prevent NPE when HTTP response fails in KsqlTarget#10988
Merged
Parag Badani (pbadani) merged 1 commit into7.4.xfrom Mar 25, 2026
Merged
fix: prevent NPE when HTTP response fails in KsqlTarget#10988Parag Badani (pbadani) merged 1 commit into7.4.xfrom
Parag Badani (pbadani) merged 1 commit into7.4.xfrom
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
This PR hardens the Vert.x HTTP response handling in KsqlTarget.execute() to avoid a NullPointerException when the response callback is invoked with a failed AsyncResult.
Changes:
- Add an early
returnaftercompleteExceptionally(...)whenresponse.failed()is true, preventing fall-through toresponseHandler.accept(response.result(), ...).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
520
to
526
| httpClientRequest.response(response -> { | ||
| if (response.failed()) { | ||
| vcf.completeExceptionally(response.cause()); | ||
| return; | ||
| } | ||
|
|
||
| responseHandler.accept(response.result(), vcf); |
e067f42 to
c78cc4c
Compare
c78cc4c to
c4f40bd
Compare
Vedarth Sharma (VedarthConfluent)
approved these changes
Mar 25, 2026
Parag Badani (pbadani)
added a commit
that referenced
this pull request
Mar 26, 2026
* fix: prevent NPE when HTTP response fails in KsqlTarget (#10988) * Fix compilation error in the unit test. (#10990) --------- Co-authored-by: Parag Badani <pbadani@users.noreply.github.com> Co-authored-by: semaphore-agent-production[bot] <117926516+semaphore-agent-production[bot]@users.noreply.github.com> Co-authored-by: Parag Badani <pbadani@confluent.io>
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
NullPointerExceptioninKsqlTarget.execute()when the Vert.x HTTP response handler fires with a failed async resultresponse.result()returnsnullon failure, but code was falling through toresponseHandler.accept(response.result(), vcf), causing NPE atKsqlTarget.java:360(resp.statusCode())returnaftervcf.completeExceptionally(response.cause())to exit the handler early on failureRoot Cause
Test plan
KsqlRestClientExceptioninstead of an NPE🤖 Generated with Claude Code