From 96e9ec898030c0e39b005863dfad1e4892a1e5f0 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Fri, 24 Nov 2023 22:11:30 +0100 Subject: [PATCH] Relax ordering mode of `TransactionProxy::closed` modifications There's no need in release-store in commit/rollback and acquire-load in destructor anymore since we don't care for commit to have finished in the destructor anymore. --- query-engine/driver-adapters/src/proxy.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/query-engine/driver-adapters/src/proxy.rs b/query-engine/driver-adapters/src/proxy.rs index c065c8eb0487..19693453988e 100644 --- a/query-engine/driver-adapters/src/proxy.rs +++ b/query-engine/driver-adapters/src/proxy.rs @@ -610,7 +610,7 @@ impl TransactionProxy { /// will not attempt rolling the transaction back even if the `commit` future was dropped while /// waiting on the JavaScript call to complete and deliver response. pub async fn commit(&self) -> quaint::Result<()> { - self.closed.store(true, Ordering::Release); + self.closed.store(true, Ordering::Relaxed); self.commit.call(()).await } @@ -630,14 +630,14 @@ impl TransactionProxy { /// will not attempt rolling back again even if the `rollback` future was dropped while waiting /// on the JavaScript call to complete and deliver response. pub async fn rollback(&self) -> quaint::Result<()> { - self.closed.store(true, Ordering::Release); + self.closed.store(true, Ordering::Relaxed); self.rollback.call(()).await } } impl Drop for TransactionProxy { fn drop(&mut self) { - if self.closed.swap(true, Ordering::Acquire) { + if self.closed.swap(true, Ordering::Relaxed) { return; }