-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(banking-stage): shutdown log spam #9417
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,7 @@ use { | |
| }, | ||
| time::Instant, | ||
| }, | ||
| tokio_util::sync::CancellationToken, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this suitable outside async contexts?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pretty sure, it's just either an atomic operation if the runtime isnt parked or a syscall to unpark the runtime (should be a write syscall for our single threaded runtime). Fairly sure this is where we get to on our sync caller side: pub fn wake(self) {
// The actual wakeup call is delegated through a virtual function call
// to the implementation which is defined by the executor.
// Don't call `drop` -- the waker will be consumed by `wake`.
let this = ManuallyDrop::new(self);
// SAFETY: This is safe because `Waker::from_raw` is the only way
// to initialize `wake` and `data` requiring the user to acknowledge
// that the contract of `RawWaker` is upheld.
unsafe { (this.waker.vtable.wake)(this.waker.data) };
}After this the queued waker runs which is type erased. Most likely this is the wake method on the other side: pub(crate) fn wake(&self) -> io::Result<()> {
// The epoll emulation on some illumos systems currently requires
// the eventfd to be read before an edge-triggered read event is
// generated.
// See https://www.illumos.org/issues/16700.
#[cfg(target_os = "illumos")]
self.reset()?;
let buf: [u8; 8] = 1u64.to_ne_bytes();
match (&self.fd).write(&buf) {
Ok(_) => Ok(()),
Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => {
// Writing only blocks if the counter is going to overflow.
// So we'll reset the counter to 0 and wake it again.
self.reset()?;
self.wake()
}
Err(err) => Err(err),
}
} |
||
| }; | ||
|
|
||
| mod transaction { | ||
|
|
@@ -56,6 +57,7 @@ pub const UNPROCESSED_BUFFER_STEP_SIZE: usize = 16; | |
|
|
||
| pub struct VoteWorker { | ||
| exit: Arc<AtomicBool>, | ||
| shutdown_signal: CancellationToken, | ||
|
apfitzge marked this conversation as resolved.
|
||
| decision_maker: DecisionMaker, | ||
| tpu_receiver: VotePacketReceiver, | ||
| gossip_receiver: VotePacketReceiver, | ||
|
|
@@ -67,6 +69,7 @@ pub struct VoteWorker { | |
| impl VoteWorker { | ||
| pub fn new( | ||
| exit: Arc<AtomicBool>, | ||
| shutdown_signal: CancellationToken, | ||
| decision_maker: DecisionMaker, | ||
| tpu_receiver: VotePacketReceiver, | ||
| gossip_receiver: VotePacketReceiver, | ||
|
|
@@ -76,6 +79,7 @@ impl VoteWorker { | |
| ) -> Self { | ||
| Self { | ||
| exit, | ||
| shutdown_signal, | ||
| decision_maker, | ||
| tpu_receiver, | ||
| gossip_receiver, | ||
|
|
@@ -110,7 +114,11 @@ impl VoteWorker { | |
| VoteSource::Tpu, | ||
| ) { | ||
| Ok(()) | Err(RecvTimeoutError::Timeout) => (), | ||
| Err(RecvTimeoutError::Disconnected) => break, | ||
| Err(RecvTimeoutError::Disconnected) => { | ||
| self.shutdown_signal.cancel(); | ||
|
|
||
| break; | ||
| } | ||
| } | ||
| // Check for new packets from the gossip receiver | ||
| match self.gossip_receiver.receive_and_buffer_packets( | ||
|
|
@@ -120,7 +128,11 @@ impl VoteWorker { | |
| VoteSource::Gossip, | ||
| ) { | ||
| Ok(()) | Err(RecvTimeoutError::Timeout) => (), | ||
| Err(RecvTimeoutError::Disconnected) => break, | ||
| Err(RecvTimeoutError::Disconnected) => { | ||
| self.shutdown_signal.cancel(); | ||
|
|
||
| break; | ||
| } | ||
| } | ||
| banking_stage_stats.report(1000); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.