Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminate worker subprocess in standalone mode #707

Closed
nkaretnikov opened this issue Dec 16, 2023 · 0 comments · Fixed by #709
Closed

Terminate worker subprocess in standalone mode #707

nkaretnikov opened this issue Dec 16, 2023 · 0 comments · Fixed by #709
Assignees
Labels

Comments

@nkaretnikov
Copy link
Contributor

nkaretnikov commented Dec 16, 2023

Context

When running with --standalone, conda-store spins up a celery worker subprocess. That subprocess is not terminated when you Ctrl-C the main process. This needs to be done in a way that would work on Linux, Windows, macOS.

conda-store-server/conda_store_server/server/app.py

        # start worker if in standalone mode
        if self.standalone:
            import multiprocessing

            multiprocessing.set_start_method("spawn")

            from conda_store_server.worker.app import CondaStoreWorker

            process = multiprocessing.Process(target=CondaStoreWorker.launch_instance)
            process.start()

#513 (comment)

If we do want it, it's possible to forcibly control-c out of the standalone server in a way that leaves the worker processes intact. See Revisit the implementation of --standalone as well as the assumptions made #513 (comment). However, I've also noticed that this is somewhat of an issue with celery itself, even when the worker is run separately, that cancellation doesn't work very smoothly. The difference is that when workers are run separately, the process doesn't end until the workers are actually shutdown. Not clear how important this issue is. It comes up during development, but I don't know if it comes up in deployment.

Value and/or benefit

Improved UX.

Anything else?

No response

@nkaretnikov nkaretnikov added the needs: triaging 🚦 Someone needs to have a look at this issue and triage label Dec 16, 2023
@nkaretnikov nkaretnikov added area: user experience 👩🏻‍💻 Items impacting the end-user experience area: configuration ⚙️ project: challenges and removed needs: triaging 🚦 Someone needs to have a look at this issue and triage labels Dec 16, 2023
@nkaretnikov nkaretnikov added this to the challenges 🛠 milestone Dec 16, 2023
@nkaretnikov nkaretnikov moved this from New 🚦 to In Progress 🏗 in conda-store 🐍 Dec 16, 2023
@nkaretnikov nkaretnikov moved this from In Progress 🏗 to New 🚦 in conda-store 🐍 Dec 16, 2023
@nkaretnikov nkaretnikov moved this from New 🚦 to In Progress 🏗 in conda-store 🐍 Dec 17, 2023
@nkaretnikov nkaretnikov self-assigned this Dec 17, 2023
nkaretnikov added a commit to nkaretnikov/conda-store that referenced this issue Dec 17, 2023
@nkaretnikov nkaretnikov moved this from In Progress 🏗 to In review 👀 in conda-store 🐍 Dec 18, 2023
nkaretnikov added a commit to nkaretnikov/conda-store that referenced this issue Jan 4, 2024
@github-project-automation github-project-automation bot moved this from In review 👀 to Done 💪🏾 in conda-store 🐍 Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant