Ted-Jiang commented on code in PR #188:
URL: https://github.com/apache/arrow-ballista/pull/188#discussion_r963370900


##########
ballista/rust/scheduler/src/state/task_manager.rs:
##########
@@ -519,4 +589,54 @@ impl<T: 'static + AsLogicalPlan, U: 'static + 
AsExecutionPlan> TaskManager<T, U>
             .take(7)
             .collect()
     }
+
+    async fn clean_up_job_data(
+        state: Arc<dyn StateBackendClient>,
+        active_job_cache: ExecutionGraphCache,
+        failed: bool,
+        job_id: String,
+        executor_manager: Option<ExecutorManager>,
+    ) -> Result<()> {
+        let mut active_graph_cache = active_job_cache.write().await;
+        active_graph_cache.remove(&job_id);
+
+        let keyspace = if failed {
+            Keyspace::FailedJobs
+        } else {
+            Keyspace::CompletedJobs
+        };
+
+        let lock = state.lock(keyspace.clone(), "").await?;

Review Comment:
   I think this will lock the whole 🤔 in standalone
   
   ```
    async fn lock(&self, keyspace: Keyspace, key: &str) -> Result<Box<dyn 
Lock>> {
           let mut mlock = self.locks.lock().await;
           let lock_key = format!("/{:?}/{}", keyspace, key);
           if let Some(lock) = mlock.get(&lock_key) {
               Ok(Box::new(lock.clone().lock_owned().await))
           } else {
               let new_lock = Arc::new(Mutex::new(()));
               mlock.insert(lock_key, new_lock.clone());
               Ok(Box::new(new_lock.lock_owned().await))
           }
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to