Skip to content

Commit 1fb4f60

Browse files
memory_order_relaxed
1 parent da4338f commit 1fb4f60

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

crates/core/src/client/client_connection.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ impl ClientConnectionSender {
160160
}
161161

162162
pub fn is_cancelled(&self) -> bool {
163-
// We check this when processing subscription updates to exit early for dropped clients.
164-
// We use `Acquire` here because we prioritize early exit over cheaper loads.
165-
self.cancelled.load(Ordering::Acquire)
163+
self.cancelled.load(Ordering::Relaxed)
166164
}
167165

168166
/// Send a message to the client. For data-related messages, you should probably use
@@ -182,9 +180,7 @@ impl ClientConnectionSender {
182180
// the channel, so forcibly kick the client
183181
tracing::warn!(identity = %self.id.identity, connection_id = %self.id.connection_id, "client channel capacity exceeded");
184182
self.abort_handle.abort();
185-
// We check this when processing subscription updates to exit early for dropped clients.
186-
// We use `Release` here because we prioritize early exit over cheaper stores.
187-
self.cancelled.store(true, Ordering::Release);
183+
self.cancelled.store(true, Ordering::Relaxed);
188184
return Err(ClientSendError::Cancelled);
189185
}
190186
Err(mpsc::error::TrySendError::Closed(_)) => return Err(ClientSendError::Disconnected),

crates/core/src/subscription/module_subscription_manager.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,9 +1290,7 @@ struct SendWorkerClient {
12901290

12911291
impl SendWorkerClient {
12921292
fn is_dropped(&self) -> bool {
1293-
// We check this when processing subscription updates to exit early for dropped clients.
1294-
// We use `Acquire` here because we prioritize early exit over cheaper loads.
1295-
self.dropped.load(Ordering::Acquire)
1293+
self.dropped.load(Ordering::Relaxed)
12961294
}
12971295

12981296
fn is_cancelled(&self) -> bool {

0 commit comments

Comments
 (0)