Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add null checks to vertx 4.5.1 instrumentation #1927

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

kanderson250
Copy link
Contributor

Resolves #1774

Customers were seeing NPEs after upgrading to version 8.9.0 of the agent, which added support for vertx 4.5.1. The NPEs were happening inside our AsyncHandlerWrapper class.

This PR updates the instrumentation to prevent the creation of an AsyncHandlerWrapper if the original resultHandler is null. A further null check is added to AsyncHandlerWrapper itself to safeguard against the possibility that handle might get called twice somewhere later in the code.

I added a unit test where the resultHandler is null. However, this test isn't a "true" test because the existing NPE doesn't cause the test to fail (this NPE occurs off the main thread). Instead, an ugly SEVERE message appears in the stack trace without the fix.

I wasn't able to find a way to improve the test to truly capture the NPE, but decided to leave it in just to verify that the transaction and future handling still works as expected.

@kanderson250 kanderson250 reopened this Jun 4, 2024
@kanderson250 kanderson250 requested review from meiao and jtduffy June 4, 2024 21:08
@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.67%. Comparing base (5dcd0a8) to head (fc2a52f).
Report is 9 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1927      +/-   ##
============================================
+ Coverage     70.66%   70.67%   +0.01%     
- Complexity     9858     9860       +2     
============================================
  Files           826      826              
  Lines         39804    39792      -12     
  Branches       6062     6061       -1     
============================================
- Hits          28127    28123       -4     
+ Misses         8951     8946       -5     
+ Partials       2726     2723       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kanderson250 kanderson250 merged commit a418735 into main Jun 5, 2024
219 of 220 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add vertx-core-4.5.3 AsyncHandlerWrapper instrumentation
3 participants