diff --git a/.github/workflows/update-integration-tests.yml b/.github/workflows/update-integration-tests.yml index 7e40b3a3..f82d56fc 100644 --- a/.github/workflows/update-integration-tests.yml +++ b/.github/workflows/update-integration-tests.yml @@ -28,7 +28,7 @@ jobs: run: git config --global hub.protocol https - name: Checkout the branch from the PR that triggered the job - run: hub pr checkout ${{ github.event.inputs.number || github.event.issue.number }} + run: gh pr checkout ${{ github.event.inputs.number || github.event.issue.number }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/jupyter_scheduler/scheduler.py b/jupyter_scheduler/scheduler.py index ff08b681..cbe2acb8 100644 --- a/jupyter_scheduler/scheduler.py +++ b/jupyter_scheduler/scheduler.py @@ -1,7 +1,7 @@ +import multiprocessing as mp import os import random import shutil -from multiprocessing import Process from typing import Dict, Optional, Type, Union import fsspec @@ -403,7 +403,15 @@ def create_job(self, model: CreateJob) -> str: staging_paths = self.get_staging_paths(DescribeJob.from_orm(job)) self.copy_input_file(model.input_uri, staging_paths["input"]) - p = Process( + # The MP context forces new processes to not be forked on Linux. + # This is necessary because `asyncio.get_event_loop()` is bugged in + # forked processes in Python versions below 3.12. This method is + # called by `jupyter_core` by `nbconvert` in the default executor. + # + # See: https://github.com/python/cpython/issues/66285 + # See also: https://github.com/jupyter/jupyter_core/pull/362 + mp_ctx = mp.get_context("spawn") + p = mp_ctx.Process( target=self.execution_manager_class( job_id=job.job_id, staging_paths=staging_paths, diff --git a/ui-tests/tests/jupyter_scheduler.spec.ts-snapshots/list-view-linux.png b/ui-tests/tests/jupyter_scheduler.spec.ts-snapshots/list-view-linux.png index 95b7a60d..54486d27 100644 Binary files a/ui-tests/tests/jupyter_scheduler.spec.ts-snapshots/list-view-linux.png and b/ui-tests/tests/jupyter_scheduler.spec.ts-snapshots/list-view-linux.png differ