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

Dynflow collects stack trace across action suspends #388

Closed
adamruzicka opened this issue May 4, 2021 · 0 comments · Fixed by #389
Closed

Dynflow collects stack trace across action suspends #388

adamruzicka opened this issue May 4, 2021 · 0 comments · Fixed by #389
Milestone

Comments

@adamruzicka
Copy link
Contributor

adamruzicka commented May 4, 2021

If an action suspends itself and on resume raises an exception, the printed stacktrace does not contain only trace from the resume to the place where the exception was raised, but it also includes the part leading to the suspend. Additionally, the traces accumulate over any number of suspends and resumes. If an action suspends, resumes, suspends and then raises an exception, the trace goes from start to suspend, from resume to suspend and finally from resume to raise. While this might be useful when developing dynflow internals, its usefulness in production deployments is debatable at best.

This is especially harmful with long running polling actions, which can accumulate huge amount of stack traces while they're active. And even if the stacktrace isn't printed, it is still collected leading to memory bloat.

For reproducer see gist

The formula for number of lines being emitted is lines = 53 * $SUSPEND_COUNT + 76, formula for output size is bytes = 4415 * SUSPEND_COUNT + 6470.

Number of suspends before raise Stacktrace length [lines] Stacktrace size [bytes]
1 129 10885
5 341 28545
10 606 50620
50 2726 227220
100 5376 447970
500 26576 2213970
1000 53076 4421470

I'm not sure how much of an issue is this in sidekiq-based deployments where events actually cross process borders.

BZ https://bugzilla.redhat.com/show_bug.cgi?id=1877917

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 a pull request may close this issue.

1 participant