Skip to content

Commit 7998afc

Browse files
committed
use spawn_process in create_job
1 parent 01895b0 commit 7998afc

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

jupyter_scheduler/scheduler.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -478,23 +478,14 @@ def create_job(self, model: CreateJob) -> str:
478478
else:
479479
self.copy_input_file(model.input_uri, staging_paths["input"])
480480

481-
# The MP context forces new processes to not be forked on Linux.
482-
# This is necessary because `asyncio.get_event_loop()` is bugged in
483-
# forked processes in Python versions below 3.12. This method is
484-
# called by `jupyter_core` by `nbconvert` in the default executor.
485-
#
486-
# See: https://github.com/python/cpython/issues/66285
487-
# See also: https://github.com/jupyter/jupyter_core/pull/362
488-
mp_ctx = mp.get_context("spawn")
489-
p = mp_ctx.Process(
481+
p = spawn_process(
490482
target=self.execution_manager_class(
491483
job_id=job.job_id,
492484
staging_paths=staging_paths,
493485
root_dir=self.root_dir,
494486
db_url=self.db_url,
495487
).process
496488
)
497-
p.start()
498489

499490
job.pid = p.pid
500491
session.commit()

0 commit comments

Comments
 (0)