Skip to content

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
apache:mainfrom
96loveslife:fix-nutz-http-plugin-npe
Open

Fix the SenderSendInterceptor in the nutz-plugin/http-1.x-plugin to avoid NPE caused by the Response status#815
96loveslife wants to merge 1 commit into
apache:mainfrom
96loveslife:fix-nutz-http-plugin-npe

Conversation

@96loveslife

Copy link
Copy Markdown
  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
  • Update the CHANGES log.

@wu-sheng wu-sheng added the bug Something isn't working label Jul 24, 2026
@wu-sheng wu-sheng added this to the 9.7.0 milestone Jul 24, 2026
@wu-sheng
wu-sheng requested a review from Copilot July 24, 2026 06:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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#afterMethod to avoid dereferencing a null Response.
  • Add a release note entry in CHANGES.md for 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 calls afterMethod(..., ret=null) and asserts it does not throw, and (optionally) another case for status >= 400 to 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.

Comment thread CHANGES.md
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants