Closed kanderson250 closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 70.67%. Comparing base (
5dcd0a8
) to head (fc2a52f
). Report is 9 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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 originalresultHandler
is null. A further null check is added toAsyncHandlerWrapper
itself to safeguard against the possibility thathandle
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.