-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Fix crash in spans when time() is not monotonic #7960
Conversation
Mostly just curious but if the problem is that |
Because |
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 20 files ± 0 20 suites ±0 11h 29m 50s ⏱️ + 38m 22s For more details on these failures, see this check. Results for commit 0d8ee46. ± Comparison against base commit a47cb0a. ♻️ This comment has been updated with latest results. |
distributed/spans.py
Outdated
# Note: in case of identical timestamps, there may be loops after sorting | ||
# were n_active < 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, child.enqueued <= child.stop
. How about sorting by timestamp only events.sort(key=lambda event: event[0])
? This should maintain relative ordering and avoid n_active < 0
. (It took me a moment to understand why n_active
would ever drop below 0 here.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
f505991
to
162cd7d
Compare
162cd7d
to
0d8ee46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fix crash:
This was triggered when two subsequent calls to
time()
are not strictly monotonic ascending.No unit tests, as I'm not too eager to monkey-patch
time()
to reproduce