Skip to content

Commit 236b1ea

Browse files
committed
use worker_id independent of twmq lease token
1 parent cc9bb23 commit 236b1ea

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

  • executors/src/eoa/worker

executors/src/eoa/worker/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ use crate::eoa::authorization_cache::EoaAuthorizationCache;
2323
use crate::eoa::store::{
2424
AtomicEoaExecutorStore, EoaExecutorStore, EoaExecutorStoreKeys, EoaHealth, SubmissionResult,
2525
};
26-
use crate::metrics::{calculate_duration_seconds, calculate_duration_seconds_from_twmq, current_timestamp_ms, record_eoa_job_processing_time};
26+
use crate::metrics::{
27+
calculate_duration_seconds, current_timestamp_ms, record_eoa_job_processing_time,
28+
};
2729
use crate::webhook::WebhookJobHandler;
2830

2931
pub mod confirm;
@@ -148,20 +150,22 @@ where
148150
})
149151
.map_err_nack(Some(Duration::from_secs(10)), RequeuePosition::Last)?;
150152

153+
let worker_id = format!("{}:{}", uuid::Uuid::new_v4(), job.lease_token);
154+
151155
// 2. CREATE SCOPED STORE (acquires lock)
152156
let scoped = EoaExecutorStore::new(
153157
self.redis.clone(),
154158
self.namespace.clone(),
155159
data.eoa_address,
156160
data.chain_id,
157161
)
158-
.acquire_eoa_lock_aggressively(&job.lease_token)
162+
.acquire_eoa_lock_aggressively(&worker_id)
159163
.await
160164
.map_err(|e| Into::<EoaExecutorWorkerError>::into(e).handle())?;
161165

162166
let delegated_account = DelegatedAccount::new(data.eoa_address, chain.clone());
163167

164-
// if there's an error checking 7702 delegation here, we'll just assume it's not a minimal account for the pursposes of max in flight
168+
// if there's an error checking 7702 delegation here, we'll just assume it's not a minimal account for the purposes of max in flight
165169
let is_minimal_account = self
166170
.authorization_cache
167171
.is_minimal_account(&delegated_account)
@@ -192,7 +196,7 @@ where
192196
let job_start_time = current_timestamp_ms();
193197
let result = worker.execute_main_workflow().await?;
194198
if let Err(e) = worker.release_eoa_lock().await {
195-
tracing::error!(error = ?e, "Error releasing EOA lock");
199+
tracing::error!(error = ?e, worker_id = worker_id, "Error releasing EOA lock");
196200
}
197201

198202
// Record EOA job processing metrics

0 commit comments

Comments
 (0)