Skip to content

Commit 9e167a4

Browse files
committed
chore(coprocessor): handle case no-dcid-available
1 parent 8e4ef19 commit 9e167a4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

coprocessor/fhevm-engine/tfhe-worker/src/dependence_chain.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ impl LockMngr {
171171
)
172172
OR (
173173
lock_expires_at < NOW() -- Work-stealing of expired locks
174+
AND
175+
dependency_count = 0 -- No pending dependencies
174176
)
175177
ORDER BY last_updated_at ASC -- FIFO
176178
FOR UPDATE SKIP LOCKED -- Ensure no other worker is currently trying to lock it
@@ -441,6 +443,10 @@ impl LockMngr {
441443
}
442444

443445
pub async fn do_cleanup(&mut self) -> Result<u64, sqlx::Error> {
446+
if self.disable_locking {
447+
return Ok(0);
448+
}
449+
444450
let should_run_cleanup = self
445451
.last_cleanup_at
446452
.map(|t| {

coprocessor/fhevm-engine/tfhe-worker/src/tfhe_worker.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@ async fn query_for_work<'a>(
373373
};
374374

375375
if deps_chain_mngr.enabled() && dependence_chain_id.is_none() {
376+
// No dependence chain to lock, so no work to do
377+
health_check.update_db_access();
376378
health_check.update_activity();
379+
info!(target: "tfhe_worker", "No dcid found to process");
377380
return Ok((vec![], vec![]));
378381
}
379382

0 commit comments

Comments
 (0)