Skip to content

[HEAVILY WIP] ref(tracing): Refactor IdleTimeout Algorithm #4471

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
wants to merge 8 commits into from

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Jan 28, 2022

🚧 WIP πŸ—οΈ

Based on #4442 (comment)

I just pushed this up for size bot

In prep for adding a double timeout to tracing, we first start by
removing the heartbeat from transactions, which should be covered by the
existence of the final timeout.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2022

size-limit report

Path Base Size (86fa701) Current Size Change
@sentry/browser - CDN Bundle (gzipped) 19.68 KB 19.68 KB +0.02% πŸ”Ί
@sentry/browser - CDN Bundle (minified) 62.89 KB 62.9 KB +0.01% πŸ”Ί
@sentry/browser - Webpack 22.21 KB 22.21 KB 0%
@sentry/browser - Webpack - gzip = false 76.02 KB 76.02 KB 0%
@sentry/react - Webpack 22.24 KB 22.24 KB 0%
@sentry/nextjs Client - Webpack 46.23 KB 46.03 KB -0.45% πŸ”½
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.22 KB 28.05 KB -0.62% πŸ”½

Copy link
Member

@k-fish k-fish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably just implement finalTimeout in this PR but have it be optional (set the default to undefined, only if passed a finalTimeout will the setTimeout for final be called). That way after this is merge we can try it right away on ourselves.

Other than that, a couple things around how idleTimeout could be changed, I think the removal of heartbeat will cause it to be a bit more sensitive. Not sure if we should leave improving idleTimeout for later, or we want to try this on ourselves first to see the % difference in idleTimeout reasons.

});

function createIdleTransction(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createIdleTransaction

*
* Time is in ms
*
* Default: 10000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we say 10_000 is a bit too short given that many transactions will be on 3g connections etc?

export const DEFAULT_IDLE_TIMEOUT = 1000;
export const HEARTBEAT_INTERVAL = 5000;
// 10 seconds
export const DEFAULT_FINAL_TIMEOUT = 10000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above, should likely bump final timeout.

Comment on lines +87 to +89
this._finalTimeoutID = setTimeout(() => {

}, this._finalTimeout)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.setTag(FINISH_REASON_TAG, <final>);
this.finish();

???

}

if (Object.keys(this.activities).length === 0) {
if (Object.keys(this._activities).length === 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm if activities includes ongoing http requests? I was thinking along the lines of TTI quiescence (see https://github.com/WICG/time-to-interactive#definition)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup can confirm it does.

@AbhiPrasad
Copy link
Member Author

Closing this in favour of alternate implementation

@AbhiPrasad AbhiPrasad closed this Feb 9, 2022
@AbhiPrasad AbhiPrasad deleted the abhi-double-timeout branch February 9, 2022 18:58
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.

2 participants