Fix the SenderSendInterceptor in the nutz-plugin/http-1.x-plugin to avoid NPE caused by the Response status#815
Open
96loveslife wants to merge 1 commit into
Open
Conversation
… avoid NPE caused by the Response status
There was a problem hiding this comment.
Pull request overview
Fixes a null-handling bug in the Nutz HTTP 1.x plugin’s SenderSendInterceptor that could trigger an NPE when the intercepted send() call returns null, and documents the fix in the changelog.
Changes:
- Correct the response null-check in
SenderSendInterceptor#afterMethodto avoid dereferencing a nullResponse. - Add a release note entry in
CHANGES.mdfor the bug fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| CHANGES.md | Adds a release note for the Nutz HTTP 1.x interceptor NPE fix. |
| apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/http/sync/SenderSendInterceptor.java | Fixes the null-check so status tagging/error marking only runs when Response is non-null. |
Comments suppressed due to low confidence (1)
apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/http/sync/SenderSendInterceptor.java:72
- This change fixes a null-handling bug, but the existing unit test (
SenderInterceptorTest) only exercises the non-null response path. Add a regression test that callsafterMethod(..., ret=null)and asserts it does not throw, and (optionally) another case forstatus >= 400to verify the span is marked as error.
if (response != null) {
Tags.HTTP_RESPONSE_STATUS_CODE.set(span, response.getStatus());
if (response.getStatus() >= 400) {
span.errorOccurred();
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Fix an issue where `JDBCPluginConfig.Plugin.JDBC.SQL_BODY_MAX_LENGTH` was not honored by clickhouse-0.3.1 and clickhouse-0.3.2.x plugins. | ||
| - Add tracing support for vector-store retrieval operations. | ||
| * Fix agent lifecycle events: the Start event now carries the service instance name, and the Shutdown event is delivered on graceful JVM exit. `ServiceManager` prepares/starts higher-priority `BootService`s first and shuts them down last (matching `BootService#priority()`), and the shutdown event refreshes its gRPC deadline before sending. | ||
| * Fix the `SenderSendInterceptor` in the nutz-plugin/http-1.x-plugin to avoid NPE caused by the Response status. |
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.
CHANGESlog.