Skip to content

Commit ee7a802

Browse files
memory_order_relaxed
1 parent 28c89ce commit ee7a802

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
@@ -1278,9 +1278,7 @@ struct SendWorkerClient {
12781278

12791279
impl SendWorkerClient {
12801280
fn is_dropped(&self) -> bool {
1281-
// We check this when processing subscription updates to exit early for dropped clients.
1282-
// We use `Acquire` here because we prioritize early exit over cheaper loads.
1283-
self.dropped.load(Ordering::Acquire)
1281+
self.dropped.load(Ordering::Relaxed)
12841282
}
12851283

12861284
fn is_cancelled(&self) -> bool {

0 commit comments

Comments
 (0)