Skip to content
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

chore(deps): bump event-listener from 2.5.3 to 5.3.0 #795

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/curp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ curp-test-utils = { path = "../curp-test-utils" }
dashmap = "5.5.0"
derive_builder = "0.20.0"
engine = { path = "../engine" }
event-listener = "2.5.2"
event-listener = "5.3.0"
flume = "0.11.0"
fs2 = "0.4.3"
futures = "0.3.21"
Expand Down
4 changes: 2 additions & 2 deletions crates/curp/src/client/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,15 @@ impl State {
info!("client term updates to {term}, client leader id updates to {new_leader_id}");
state.term = term;
state.leader = Some(new_leader_id);
self.immutable.leader_notifier.notify(usize::MAX);
let _ignore = self.immutable.leader_notifier.notify(usize::MAX);
}
}
Ordering::Equal => {
if let Some(new_leader_id) = leader_id {
if state.leader.is_none() {
info!("client leader id updates to {new_leader_id}");
state.leader = Some(new_leader_id);
self.immutable.leader_notifier.notify(usize::MAX);
let _ignore = self.immutable.leader_notifier.notify(usize::MAX);
}
assert_eq!(
state.leader,
Expand Down
26 changes: 13 additions & 13 deletions crates/curp/src/server/cmd_board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ impl<C: Command> CommandBoard<C> {

/// Release notifiers
pub(super) fn release_notifiers(&mut self) {
self.er_notifiers
.drain()
.for_each(|(_, event)| event.notify(usize::MAX));
self.asr_notifiers
.drain()
.for_each(|(_, event)| event.notify(usize::MAX));
self.er_notifiers.drain().for_each(|(_, event)| {
let _ignore = event.notify(usize::MAX);
});
self.asr_notifiers.drain().for_each(|(_, event)| {
let _ignore = event.notify(usize::MAX);
});
}

/// Clear
Expand Down Expand Up @@ -104,7 +104,7 @@ impl<C: Command> CommandBoard<C> {
let event = self.er_notifiers.entry(id).or_default();
let listener = event.listen();
if self.er_buffer.contains_key(&id) {
event.notify(usize::MAX);
let _ignore = event.notify(usize::MAX);
}
listener
}
Expand All @@ -119,7 +119,7 @@ impl<C: Command> CommandBoard<C> {
let event = self.asr_notifiers.entry(id).or_default();
let listener = event.listen();
if self.asr_buffer.contains_key(&id) {
event.notify(usize::MAX);
let _ignore = event.notify(usize::MAX);
}
listener
}
Expand All @@ -129,34 +129,34 @@ impl<C: Command> CommandBoard<C> {
let event = self.conf_notifier.entry(id).or_default();
let listener = event.listen();
if self.conf_buffer.contains(&id) {
event.notify(usize::MAX);
let _ignore = event.notify(usize::MAX);
}
listener
}

/// Notify execution results
fn notify_er(&mut self, id: &ProposeId) {
if let Some(notifier) = self.er_notifiers.remove(id) {
notifier.notify(usize::MAX);
let _ignore = notifier.notify(usize::MAX);
}
}

/// Notify `wait_synced` requests
fn notify_asr(&mut self, id: &ProposeId) {
if let Some(notifier) = self.asr_notifiers.remove(id) {
notifier.notify(usize::MAX);
let _ignore = notifier.notify(usize::MAX);
}
}

/// Notify `shutdown` requests
pub(super) fn notify_shutdown(&mut self) {
self.shutdown_notifier.notify(usize::MAX);
let _ignore = self.shutdown_notifier.notify(usize::MAX);
}

/// Notify `wait_synced` requests
fn notify_conf(&mut self, id: &ProposeId) {
if let Some(notifier) = self.conf_notifier.remove(id) {
notifier.notify(usize::MAX);
let _ignore = notifier.notify(usize::MAX);
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/curp/src/server/curp_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ impl<C: Command, RC: RoleChange> CurpNode<C, RC> {
change.node_id
);
};
event.notify(1);
let _ignore = event.notify(1);
}
ConfChangeType::Update => {
if let Err(e) = curp.update_connect(change.node_id, change.address).await {
Expand Down
16 changes: 8 additions & 8 deletions crates/curp/src/server/raw_curp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ impl<C: Command, RC: RoleChange> RawCurp<C, RC> {
/// Handle `vote` responses
/// Return `Ok(election_ends)` if succeeds
/// Return `Err(())` if self is no longer a candidate
#[allow(clippy::shadow_unrelated)] // allow reuse the `_ignore` variable name.
pub(super) fn handle_vote_resp(
&self,
id: ServerId,
Expand All @@ -916,7 +917,7 @@ impl<C: Command, RC: RoleChange> RawCurp<C, RC> {
}

let mut cst_w = self.cst.lock();
let _ig = cst_w.votes_received.insert(id, vote_granted);
let _ignore = cst_w.votes_received.insert(id, vote_granted);

if !vote_granted {
return Ok(false);
Expand Down Expand Up @@ -954,10 +955,9 @@ impl<C: Command, RC: RoleChange> RawCurp<C, RC> {
}
if prev_last_log_index < last_log_index {
// if some entries are recovered, sync with followers immediately
self.ctx
.sync_events
.iter()
.for_each(|event| event.notify(1));
self.ctx.sync_events.iter().for_each(|event| {
let _ignore = event.notify(1);
});
}

Ok(true)
Expand Down Expand Up @@ -1098,7 +1098,7 @@ impl<C: Command, RC: RoleChange> RawCurp<C, RC> {
if match_index == self.log.read().last_log_index() {
Ok(true)
} else {
self.sync_event(target_id).notify(1);
let _ignore = self.sync_event(target_id).notify(1);
Ok(false)
}
}
Expand Down Expand Up @@ -1613,7 +1613,7 @@ impl<C: Command, RC: RoleChange> RawCurp<C, RC> {
st.role = Role::Leader;
st.leader_id = Some(self.id());
let _ig = self.ctx.leader_tx.send(Some(self.id())).ok();
self.ctx.leader_event.notify(usize::MAX);
let _ignore = self.ctx.leader_event.notify(usize::MAX);
self.ctx.role_change.on_election_win();
debug!("{} becomes the leader", self.id());
}
Expand Down Expand Up @@ -1882,7 +1882,7 @@ impl<C: Command, RC: RoleChange> RawCurp<C, RC> {
self.ctx.sync_events.iter().for_each(|e| {
if let Some(next) = self.lst.get_next_index(*e.key()) {
if next > log_w.base_index && log_w.has_next_batch(next) {
e.notify(1);
let _ignore = e.notify(1);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion crates/xline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ curp = { path = "../curp", version = "0.1.0", features = ["client-metrics"] }
curp-external-api = { path = "../curp-external-api" }
dashmap = "5.5.3"
engine = { path = "../engine" }
event-listener = "2.5.2"
event-listener = "5.3.0"
futures = "0.3.25"
hyper = "0.14.27"
itertools = "0.11"
Expand Down
3 changes: 1 addition & 2 deletions crates/xline/src/conflict/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ use xlineapi::{
LeaseRevokeRequest, PutRequest, RequestWrapper,
};

use super::spec_pool::{KvSpecPool, LeaseSpecPool};
use crate::conflict::{
spec_pool::ExclusiveSpecPool,
uncommitted_pool::{ExclusiveUncomPool, KvUncomPool, LeaseUncomPool},
};

use super::spec_pool::{KvSpecPool, LeaseSpecPool};

#[test]
fn kv_sp_operations_are_ok() {
let mut sp = KvSpecPool::default();
Expand Down
4 changes: 2 additions & 2 deletions crates/xline/src/server/barriers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl IndexBarrier {
let mut split_barriers = inner_l.barriers.split_off(&(index.overflow_add(1)));
std::mem::swap(&mut inner_l.barriers, &mut split_barriers);
for (_, barrier) in split_barriers {
barrier.notify(usize::MAX);
let _ignore = barrier.notify(usize::MAX);
}
}
}
Expand Down Expand Up @@ -82,7 +82,7 @@ impl IdBarrier {
/// Trigger the barrier of the given inflight id.
pub(crate) fn trigger(&self, id: InflightId) {
if let Some(event) = self.barriers.lock().remove(&id) {
event.notify(usize::MAX);
let _ignore = event.notify(usize::MAX);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/xline/src/server/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,14 @@ where
if let RequestWrapper::CompactionRequest(ref compact_req) = *wrapper {
if compact_req.physical {
if let Some(n) = self.compact_events.get(&cmd.compact_id()) {
n.notify(usize::MAX);
let _ignore = n.notify(usize::MAX);
}
}
};
if let RequestWrapper::CompactionRequest(ref compact_req) = *wrapper {
if compact_req.physical {
if let Some(n) = self.compact_events.get(&cmd.compact_id()) {
n.notify(usize::MAX);
let _ignore = n.notify(usize::MAX);
}
}
};
Expand Down
12 changes: 6 additions & 6 deletions crates/xline/src/server/watch_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ where
req.watch_id
)));
if self.response_tx.send(result).await.is_err() {
self.stop_notify.notify(1);
let _ignore = self.stop_notify.notify(1);
}
return;
};
Expand Down Expand Up @@ -249,7 +249,7 @@ where
..WatchResponse::default()
};
if self.response_tx.send(Ok(response)).await.is_err() {
self.stop_notify.notify(1);
let _ignore = self.stop_notify.notify(1);
}
}

Expand All @@ -273,7 +273,7 @@ where
)))
};
if self.response_tx.send(result).await.is_err() {
self.stop_notify.notify(1);
let _ignore = self.stop_notify.notify(1);
}
}

Expand Down Expand Up @@ -329,7 +329,7 @@ where
};

if self.response_tx.send(Ok(response)).await.is_err() {
self.stop_notify.notify(1);
let _ignore = self.stop_notify.notify(1);
}
if let Some(progress) = self.progress.get_mut(&watch_id) {
*progress = false;
Expand All @@ -348,7 +348,7 @@ where
.await
.is_err()
{
self.stop_notify.notify(1);
let _ignore = self.stop_notify.notify(1);
}
}

Expand All @@ -366,7 +366,7 @@ where
.await
.is_err()
{
self.stop_notify.notify(1);
let _ignore = self.stop_notify.notify(1);
}
} else {
*progress = true;
Expand Down
2 changes: 1 addition & 1 deletion crates/xline/src/storage/compact/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub(crate) async fn compact_bg_task<DB>(
panic!("failed to set finished compact revision {revision:?} due to {e}");
}
if let Some(notifier) = listener {
notifier.notify(usize::MAX);
let _ignore = notifier.notify(usize::MAX);
}
}
}
2 changes: 1 addition & 1 deletion crates/xline/src/storage/kvwatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl Watcher {
}
Err(TrySendError::Closed(_)) => {
warn!(watch_id, revision, "watcher is closed");
self.stop_notify.notify(1);
let _ignore = self.stop_notify.notify(1);
Ok(())
}
Err(TrySendError::Full(watch_event)) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/xline/src/storage/lease_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ where
};

_ = self.unsynced_cache.write().remove(&lease_id);
self.sync_event.notify(usize::MAX);
let _ignore = self.sync_event.notify(usize::MAX);
}

/// Wait for the lease id to be removed from the cache
Expand Down
Loading