@@ -463,7 +463,7 @@ def stop_task(self, task_id: str) -> bool:
463463 task_logger .info (f"Received stop request for task { task_id } ." )
464464
465465 # Check if the process is managed by this runner instance
466- process = self .runner .process_dict .get (task_id )
466+ process = self .runner ._process_dict .get (task_id )
467467 if not process :
468468 task_logger .warning (
469469 f"Task { task_id } : Process not found in runner's dictionary. "
@@ -477,7 +477,7 @@ def stop_task(self, task_id: str) -> bool:
477477 task_logger .info (
478478 f"Task { task_id } : Process with PID { process .pid } has already terminated. Cleaning up local reference."
479479 )
480- self .runner .process_dict .pop (task_id , None )
480+ self .runner ._process_dict .pop (task_id , None )
481481 return True
482482
483483 # Delegate the complex termination logic to the process manager via the runner.
@@ -489,7 +489,7 @@ def stop_task(self, task_id: str) -> bool:
489489 f"Successfully terminated process group for task { task_id } ."
490490 )
491491 # Remove from local tracking after successful termination
492- self .runner .process_dict .pop (task_id , None )
492+ self .runner ._process_dict .pop (task_id , None )
493493 return True
494494 else :
495495 task_logger .error (
@@ -525,7 +525,7 @@ def stop_task_old(self, task_id: str) -> bool:
525525 )
526526
527527 # Clean up local tracking
528- self .runner .process_dict .pop (task_id , None )
528+ self .runner ._process_dict .pop (task_id , None )
529529 if hasattr (self .runner , "_terminating_processes" ):
530530 termination_key = f"{ task_id } _terminating"
531531 self .runner ._terminating_processes .discard (termination_key )
@@ -535,13 +535,13 @@ def stop_task_old(self, task_id: str) -> bool:
535535 return True
536536
537537 # Step 2: Fallback to original process termination if multiprocess cleanup failed
538- process = self .runner .process_dict .get (task_id )
538+ process = self .runner ._process_dict .get (task_id )
539539
540540 if not process :
541541 task_logger .warning (
542542 f"Task { task_id } , Process not found in runner's dictionary. It might have finished or be on another node."
543543 )
544- self .runner .process_dict .pop (task_id , None )
544+ self .runner ._process_dict .pop (task_id , None )
545545 # Clean up task resources (do not force cleanup orphaned processes here)
546546 cleanup_task_resources (task_id )
547547 return True
@@ -550,7 +550,7 @@ def stop_task_old(self, task_id: str) -> bool:
550550 task_logger .info (
551551 f"Task { task_id } , Process with PID { process .pid } has already terminated. Cleaning up."
552552 )
553- self .runner .process_dict .pop (task_id , None )
553+ self .runner ._process_dict .pop (task_id , None )
554554 cleanup_task_resources (task_id )
555555 return True
556556
@@ -577,7 +577,7 @@ def stop_task_old(self, task_id: str) -> bool:
577577 task_logger .info (
578578 f"Task { task_id } , Process with PID { process .pid } terminated naturally while preparing to stop it."
579579 )
580- self .runner .process_dict .pop (task_id , None )
580+ self .runner ._process_dict .pop (task_id , None )
581581 self .runner ._terminating_processes .discard (termination_key )
582582 cleanup_task_resources (task_id )
583583 return True
@@ -587,7 +587,7 @@ def stop_task_old(self, task_id: str) -> bool:
587587 task_logger .info (
588588 f"Task { task_id } , Process terminated successfully via SIGTERM."
589589 )
590- self .runner .process_dict .pop (task_id , None )
590+ self .runner ._process_dict .pop (task_id , None )
591591 self .runner ._terminating_processes .discard (termination_key )
592592 cleanup_task_resources (task_id )
593593 return True
@@ -601,7 +601,7 @@ def stop_task_old(self, task_id: str) -> bool:
601601 task_logger .info (
602602 f"Task { task_id } , Process with PID { process .pid } terminated naturally during SIGTERM timeout."
603603 )
604- self .runner .process_dict .pop (task_id , None )
604+ self .runner ._process_dict .pop (task_id , None )
605605 self .runner ._terminating_processes .discard (termination_key )
606606 return True
607607
@@ -610,7 +610,7 @@ def stop_task_old(self, task_id: str) -> bool:
610610 task_logger .info (
611611 f"Task { task_id } , Process killed successfully via SIGKILL."
612612 )
613- self .runner .process_dict .pop (task_id , None )
613+ self .runner ._process_dict .pop (task_id , None )
614614 self .runner ._terminating_processes .discard (termination_key )
615615 return True
616616 except subprocess .TimeoutExpired :
@@ -630,7 +630,7 @@ def stop_task_old(self, task_id: str) -> bool:
630630 task_logger .info (
631631 f"Task { task_id } , Process with PID { process .pid } no longer exists (ProcessLookupError). Cleaning up."
632632 )
633- self .runner .process_dict .pop (task_id , None )
633+ self .runner ._process_dict .pop (task_id , None )
634634 self .runner ._terminating_processes .discard (termination_key )
635635 return True
636636 except Exception as e :
@@ -646,7 +646,7 @@ def stop_task_old(self, task_id: str) -> bool:
646646 task_logger .info (
647647 f"Task { task_id } , Process completed its natural shutdown successfully."
648648 )
649- self .runner .process_dict .pop (task_id , None )
649+ self .runner ._process_dict .pop (task_id , None )
650650 self .runner ._terminating_processes .discard (termination_key )
651651 return True
652652 except subprocess .TimeoutExpired :
@@ -659,7 +659,7 @@ def stop_task_old(self, task_id: str) -> bool:
659659 task_logger .info (
660660 f"Task { task_id } , Process force-killed successfully after natural shutdown timeout."
661661 )
662- self .runner .process_dict .pop (task_id , None )
662+ self .runner ._process_dict .pop (task_id , None )
663663 self .runner ._terminating_processes .discard (termination_key )
664664 return True
665665 except Exception as kill_e :
0 commit comments