newrelic / newrelic/newrelic-java-agent

Vert.x-core: allow use of the same listener multiple times

Open
#2,189 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3 medium technical debt
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.