Skip to content

Commit 46e3dfa

Browse files
committed
steps
1 parent 1ee0808 commit 46e3dfa

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

src/inspect_scout/_concurrency/_mp_logging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def patch_inspect_log_handler(patch_fn: Callable[[logging.LogRecord], None]) ->
1818
patch_fn: A callable that receives a LogRecord and handles it (typically by
1919
queuing it for transmission to the parent process).
2020
"""
21+
# TODO: Disabled until we fix it
2122
# object.__setattr__(find_inspect_log_handler(), "emit", patch_fn)
2223

2324

src/inspect_scout/_concurrency/_mp_subprocess.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
from __future__ import annotations
1010

11-
# IMPORTANT: Import _mp_setup FIRST to configure sys.path before unpickling
12-
from . import _mp_setup # noqa: F401
13-
1411
import logging
1512
import time
1613
from threading import Condition
@@ -23,7 +20,12 @@
2320

2421
from .._scanner.result import ResultReport
2522
from .._transcript.types import TranscriptInfo
26-
from . import _mp_common
23+
24+
# IMPORTANT: Import _mp_setup FIRST to configure sys.path before unpickling
25+
from . import (
26+
_mp_common,
27+
_mp_setup, # noqa: F401
28+
)
2729
from ._iterator import iterator_from_queue
2830
from ._mp_common import IPCContext, LoggingItem, run_sync_on_thread
2931
from ._mp_logging import patch_inspect_log_handler
@@ -73,7 +75,7 @@ def _wait_for_shutdown() -> None:
7375
def subprocess_main(
7476
worker_id: int,
7577
task_count: int,
76-
ipc_context: IPCContext,
78+
ctx: IPCContext,
7779
) -> None:
7880
"""Worker subprocess main function.
7981
@@ -83,10 +85,8 @@ def subprocess_main(
8385
Args:
8486
worker_id: Unique identifier for this worker process
8587
task_count: Number of concurrent tasks for this worker process
86-
ipc_context: Shared IPC context passed from parent process
88+
ctx: Shared IPC context passed from parent process
8789
"""
88-
# Use IPC context passed as argument (for spawn compatibility)
89-
ctx = ipc_context
9090

9191
def _log_in_parent(record: logging.LogRecord) -> None:
9292
# Strip exc_info from record to avoid pickling traceback objects since it

test_env_inherit.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

todo.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# Fork to Spawn Conversion - COMPLETED ✅
1+
# Fork to Spawn Conversion
2+
3+
## Remaining Issues
4+
5+
- [ ] Only works if cd into directory with scan job
6+
- [ ] Remaining Busted Items that relied on the fork approach
7+
Likely all of these can be fixed by performing proper initialization code in `worker_main`
8+
- [ ] Monkey patching logging
9+
- [ ] Shared concurrency model
210

311
## Final Solution
412

0 commit comments

Comments
 (0)