Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions components/spider-storage/src/state/job_cache_gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,12 @@ pub fn create_job_cache_gc<
Duration::from_secs(config.terminated_job_retention_sec),
receiver,
);
let join_handle =
tokio::spawn(async move { gc.run(cancellation_token, gc_interval_sec).await });
let join_handle = tokio::spawn(async move {
gc.run(cancellation_token.clone(), gc_interval_sec).await.inspect_err(|e| {
tracing::error!(error = % e, "Job cache GC actor exited with error. Cancelling the service.");
cancellation_token.cancel();
})
});
Ok((JobCacheGcHandle::new(sender), join_handle))
}

Expand Down
8 changes: 6 additions & 2 deletions components/spider-storage/src/task_instance_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,12 @@ pub fn create_task_instance_pool<
receiver,
};
let gc_interval_sec = config.gc_interval_sec;
let pool_join_handle =
tokio::spawn(async move { pool.run(cancellation_token, gc_interval_sec).await });
let pool_join_handle = tokio::spawn(async move {
pool.run(cancellation_token.clone(), gc_interval_sec).await.inspect_err(|e| {
tracing::error!(error = % e, "Task instance pool actor exited with error. Cancelling the service.");
cancellation_token.cancel();
})
});
let handle = TaskInstancePoolHandle {
next_task_instance_id,
sender,
Expand Down
Loading