-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
task: add task IDs #4630
Merged
task: add task IDs #4630
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1f43cb3
task: add task IDs
hawkw e77bacc
add task IDs to join errors
hawkw ece2698
assign IDs sequentially instead of by addr
hawkw 47a26c5
add task IDs to tracing spans
hawkw 09254f9
make IDs always be 64-bit
hawkw 8ead959
naming review feedback
hawkw 1fd964e
fix tests
hawkw dfb38c4
fix miri tests also
hawkw 4412f1d
block_on also wants an ID
hawkw 558a744
fixup
hawkw 9463376
rustfmt
hawkw 7567ecc
ugh somehow missed that
hawkw ca15b2f
bleh fix 32-bit code
hawkw 9a57cd4
remove duplicate attrs
hawkw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
if we store this, it should probably be in the trailer no?
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.
The header needs to stay under a cache line, but as long as CI passes, it should be good to go: https://github.com/tokio-rs/tokio/blob/master/tokio/src/runtime/task/core.rs#L266
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.
It has to be stored somewhere in the task structure because it's passed to
poll_future
andcancel_task
in order to populate aJoinError
:tokio/tokio/src/runtime/task/harness.rs
Lines 444 to 451 in a201b91
and
tokio/tokio/src/runtime/task/harness.rs
Line 479 in a201b91
It could go in the
Core
or in theTrailer
--- my sense was that theCore
contained data that's used when actually polling the task, and the trailer contains data that's only used when the task completes. Technically theId
is consumed only on completion, but inside of the functions that are called on every poll, so we would need to dereference the trailer in those functions to get the ID, and we don't currently dereference the trailer on polls.I agree that it shouldn't go in the header; it currently doesn't.