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

Instrument methods with dispatcher=true when they invoke token.link() outside of a transaction #1140

Merged
merged 3 commits into from
Feb 23, 2023

Conversation

sdaubin
Copy link
Contributor

@sdaubin sdaubin commented Feb 1, 2023

Overview

There are cases for async transactions in which customers call Token.link() outside of a transaction, which causes linking to fail. We can detect this happening and re-transforming the class so that the method is traced with transactions enabled.

To determine the calling class/method, we generate an exception and use the stack trace elements. Because we're doing this automatically, I added rate limiting so that we only try this once per second. We could make that time configurable, and we could add a config switch to completely disable this behavior.

Related Github Issue

https://issues.newrelic.com/browse/NR-74916

Testing

The referenced ticket contains an application which can be used to reproduce the issue and verify the fix.

Checks

[ ] Are your contributions backwards compatible with relevant frameworks and APIs?
[ ] Does your code contain any breaking changes? Please describe.
[ ] Does your code introduce any new dependencies? Please describe.

@kford-newrelic kford-newrelic added the on-roadmap Issue has been added to our product roadmap and will be worked in the coming quarter label Feb 14, 2023
@tbradellis tbradellis merged commit 8d8743f into newrelic:main Feb 23, 2023
@patrickjamesbarry
Copy link

"we could add a config switch to completely disable this behavior."
What is the jvm arg we could use to disable this?

@jtduffy
Copy link
Contributor

jtduffy commented Nov 21, 2023

Setting the system property -Dnewrelic.config.auto_async_link_rate_limit=0 will disable this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-roadmap Issue has been added to our product roadmap and will be worked in the coming quarter
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants