-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[narwhal] add log statements to easily trace when tasks shutdown #6696
Conversation
narwhal/consensus/src/consensus.rs
Outdated
spawn_monitored_task!(s.run()).tap(|_| { | ||
info!("Consensus task shutdown"); | ||
}) |
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.
This does not do what you think it does. This will immediately return and print the log statement.
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 you want a statement to be printed when the task itself finishes, you'll want to directly instrument the future that's being spawned.
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.
oh my that's embarrassing - can't even think why I did it this way - I'll refactor , thanks @bmwill !
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.
haha no worries, i've made similar mistakes before which is why i knew this wouldn't do what you want it to :)
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.
I would have made the same mistake! Thanks @bmwill
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.
Except @bmwill comment the PR looks good
narwhal/consensus/src/consensus.rs
Outdated
spawn_monitored_task!(s.run()).tap(|_| { | ||
info!("Consensus task shutdown"); | ||
}) |
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.
I would have made the same mistake! Thanks @bmwill
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
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.
a lot more robust!
1baf3aa
to
167054a
Compare
This PR extends the
spawn_monitored_task
macro and introduces thespawn_logged_monitored_task
in order to provide extra capabilities to print log statements when the passed in task future starts/ends. It also introduces the ability to add names for our tasks so we can easily identify them