Vert.x-core: allow use of the same listener multiple times #2189
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
Metadata
Assignees
Type
Projects
Status
Triage