@@ -2477,51 +2477,6 @@ def execute_with_activity_monitoring(
24772477
24782478 return json .loads (response_line .strip ())
24792479
2480- # Monitor activity
2481- try :
2482- cpu_percent = ps_process .cpu_percent (interval = 0.1 )
2483- memory_mb = ps_process .memory_info ().rss / 1024 / 1024
2484-
2485- # Activity detection
2486- activity_detected = False
2487-
2488- if cpu_percent > 1.0 : # CPU active
2489- activity_detected = True
2490-
2491- if abs (memory_mb - last_memory_mb ) > 1.0 : # Memory changing
2492- activity_detected = True
2493-
2494- # Check I/O activity (reading/writing data)
2495- io_counters = ps_process .io_counters ()
2496- if hasattr (self , "_last_io" ):
2497- last_io = self ._last_io
2498- if (
2499- io_counters .read_bytes > last_io .read_bytes
2500- or io_counters .write_bytes > last_io .write_bytes
2501- ):
2502- activity_detected = True
2503- self ._last_io = io_counters
2504-
2505- if activity_detected :
2506- last_activity_time = time .time ()
2507- last_cpu_percent = cpu_percent
2508- last_memory_mb = memory_mb
2509-
2510- # Check idle timeout
2511- idle_duration = time .time () - last_activity_time
2512-
2513- if idle_duration > timeout_idle_seconds :
2514- raise TimeoutError (
2515- f"Task timed out: No activity for { idle_duration :.1f} s\n "
2516- f"Last CPU: { last_cpu_percent :.1f} %, Memory: { memory_mb :.1f} MB\n "
2517- f"Task may be deadlocked or waiting indefinitely"
2518- )
2519-
2520- except psutil .NoSuchProcess :
2521- raise RuntimeError ("Worker process crashed during task execution" )
2522-
2523- time .sleep (0.1 )
2524-
25252480 def _discover_cuda_paths (self ) -> List [str ]:
25262481 """
25272482 Discover CUDA library paths for this package spec.
@@ -6800,16 +6755,6 @@ def get_version(self, package_name):
68006755 except Exception :
68016756 pass
68026757 return {"success" : False , "error" : res .get ("error" , "parse error" )}
6803- # Send evict request to daemon so the worker process is actually killed
6804- try :
6805- self .client ._send ({
6806- "type" : "evict_worker" ,
6807- "spec" : self .spec ,
6808- "python_exe" : self .python_exe or "" ,
6809- "worker_tag" : "" ,
6810- })
6811- except Exception :
6812- pass
68136758
68146759 def get_version (self , package_name ):
68156760 import json as _json
0 commit comments