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

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

Open
meiao opened this issue Jan 3, 2025 · 1 comment
Open

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

meiao opened this issue Jan 3, 2025 · 1 comment

Comments

@meiao
Copy link
Contributor

meiao commented Jan 3, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants