newrelic / newrelic/newrelic-java-agent
Vert.x-core: allow use of the same listener multiple times
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 240
- Forks
- 170
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 21
Description
Description
The Vert.x core instrumentation modifies the FutureImpl class to store a Token whenever a Listener is added. The token is stored in a Map, keyed by the Listener.
This does not work well when there is a singleton Listener, or when a Listener is reused multiple times.
First, the Token reference get lost when a Listener is added to a second FutureImpl. This causes the transaction to be open until the missing Token times out.
Second, since the Token is retrieved using the Listener, it may link to the wrong FutureImpl. For instance, a Listener is added to two FutureImpls in two different transactions. The Token stored in the map will reference the second transaction, but if the first FutureImpl executes first, it will be linked to the second transaction, instead of the first. And the second transaction will not link to a FutureImpl at all.
Acceptance Criteria
FutureImpls are linked properly to the originating transaction and no Token references are lost.
Additional context
NR-334557
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the Vert.x core instrumentation and its FutureImpl handling, then inspect how Listener registration and execution retrieve Token values from the map. Reproduce reuse of one Listener across multiple FutureImpls and transactions, and verify that each FutureImpl links to its originating transaction without lost Token references.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100