Skip to content

Commit 9d0c59e

Browse files
deepsource-autofix[bot]1minds3t
authored andcommitted
refactor: delete unreachable statements
This statement is unreachable, as the control flow will never reach upto this point. Consider removing this part of code or re-evaluating the control flow.
1 parent cbced8e commit 9d0c59e

2 files changed

Lines changed: 0 additions & 61 deletions

File tree

src/omnipkg/core.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -776,12 +776,6 @@ def _register_and_link_existing_interpreter(self, interpreter_path: Path, versio
776776
Forwarding to simple registration for backward compatibility during migration.
777777
"""
778778
return self._ensure_interpreter_registered(interpreter_path, version)
779-
# At the very end, after registration is confirmed successful:
780-
safe_print(_(" - ✅ Registered Python {} without copying").format(version))
781-
782-
# 🎯 ADD THIS HERE - Right after successful registration
783-
if platform.system() != "Windows":
784-
self._create_symlink_for_version(version)
785779

786780
def _find_python_executable(self, version: str) -> Optional[Path]:
787781
"""

src/omnipkg/isolation/worker_daemon.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)