This repository was archived by the owner on Nov 15, 2023. It is now read-only.
consensus: prioritize finality work over block import in queue#7307
Merged
consensus: prioritize finality work over block import in queue#7307
Conversation
50b0580 to
2f57ae8
Compare
bkchr
approved these changes
Oct 12, 2020
Member
bkchr
left a comment
There was a problem hiding this comment.
A test would be really really cool :P
| fn drop(&mut self) { | ||
| // Flush the queue and close the receiver to terminate the future. | ||
| self.sender.close_channel(); | ||
| self.finality_sender.close_channel(); |
Member
There was a problem hiding this comment.
https://docs.rs/futures-channel/0.3.6/src/futures_channel/mpsc/mod.rs.html#991
Actually that is done automatically :P
Contributor
Author
There was a problem hiding this comment.
I guess this was done explicitly in case there's more than one instance of the sender. I don't really have a strong opinion on this.
| use worker_messages::*; | ||
|
|
||
| let (finality_sender, mut finality_port) = | ||
| tracing_unbounded("mpsc_import_queue_worker_finality"); |
Contributor
Author
There was a problem hiding this comment.
The channel is mpsc but yeah in practice there's only one producer. But all tracing_unbounded metrics have the mpsc prefix 🤷.
octol
approved these changes
Oct 16, 2020
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The import queue should prioritize finality work over block import since finality work is less common and lighter than block import (especially during major sync), and performing the finality work can then lead to faster block import (or rather it solves slowdowns caused by longer stretches of unfinalized blocks).