Skip to content

changed(tracing): always clear timeout when new activity starts within idle timeout #4450

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

Closed

Conversation

datbth
Copy link
Contributor

@datbth datbth commented Jan 25, 2022

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

Summary

Always clear idle timeout when new activity starts within the idle timeout, by assigning the popAcitivity timeout to the instance's timeout.

Example

Before

  1. (t = 0) Starts an IdleTransaction with idleTimeout = 1000
    i. Idle timeout is created
  2. (t = 100) Push activity A
    i. Idle timeout is cleared
  3. (t = 200) Pop activity A
    i. An unstoppable idle timeout is created
  4. (t = 800) Push activity B
  5. (t = 1200) Idle timeout created in [3.i.] finishes the IdleTransaction although activity B is still active

After

  1. (t = 0) Starts an IdleTransaction with idleTimeout = 1000
    i. Idle timeout is created
  2. (t = 100) Push activity A
    i. Idle timeout is cleared
  3. (t = 200) Pop activity A
    i. Idle timeout is created
  4. (t = 800) Push activity B
    i. Idle timeout is cleared
  5. (t = 1500) Pop activity B
    i. Idle timeout is created
  6. (t = 2500) Idle timeout created in [5.i.] finishes the IdleTransaction

Notes

  • Rename _initTimeout to _idleTimeout to match its new(?) purpose more accurately.
  • Not sure if the behavior should be toggleable via an option?

@datbth datbth force-pushed the tracing/clear_timeout_on_new_activity branch from 91e3c7a to b9e9fe9 Compare January 25, 2022 10:52
@datbth
Copy link
Contributor Author

datbth commented Jan 25, 2022

duplicate of #4442

@datbth datbth closed this Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant