Skip to content

tracing: IdleTransaction is forcibly finished even though it is not idle #4559

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
7 tasks done
snoozbuster opened this issue Feb 12, 2022 · 2 comments
Closed
7 tasks done

Comments

@snoozbuster
Copy link
Contributor

Package + Version

  • @sentry/browser
  • @sentry/vue
  • @sentry/tracing

Version:

6.17.6

Description

Consider this transaction:

image

This transaction is created using vueRouterInstrumentation, in a fairly normal method:

image

Even though there are multiple API calls in progress which have not reached the 1000ms transaction timeout, the transaction is still closed and these calls are dropped. I've traced this to this particular line in the code:

setTimeout(() => {
if (!this._finished) {
this.setTag(FINISH_REASON_TAG, IDLE_TRANSACTION_FINISH_REASONS[1]);
this.finish(end);
}
}, timeout);

As far as I can tell, the intention here for IdleTransaction is:

  • Keep track of all open spans as they are pushed and popped
  • When all open spans are closed, start a timer
  • If no spans are created in that time period, close the transaction
  • additionally, run a 5s heartbeat and if no change whatsoever for 3 full beats, close the transaction

However, what this code is actually implementing is "when all open spans are closed, close the transaction immediately as soon as the idleTimeout is reached." It doesn't matter at that point if there are more spans which are added after that point, no matter how active the transaction is, it will be forcibly closed as soon as the timeout is hit. This is obvious by looking at this graph above - the transaction is closed exactly 1000ms after the first span closes and the transaction returns to 0 activities, even though a bunch of other activities are kicked off immediately afterwards and the transaction is nowhere near idle when it is closed.

Is this the true intention for IdleTransaction? If so, why, and how can I stop this from happening? It's cutting off my performance data and severely under-representing the actual time it takes for a navigation to complete and the page to be fully loaded and visible. This type of waterfall requests/rendering is pretty common for webapps, this feels like a major issue to me.

@AbhiPrasad
Copy link
Member

Hey, thanks for writing in. We are actually taking a look at this right now, see: #4531

@snoozbuster
Copy link
Contributor Author

snoozbuster commented Feb 12, 2022

aha! I did a search or two to see if this was already open but apparently I didn't search for the right things (namely, an already open PR). that's excellent to hear, I will take my feedback there!

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

No branches or pull requests

2 participants