5

I am encountering an issue while trying to run Celery tasks on my Mac M1 machine. The error message I'm getting is as follows:

The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug. [2023-11-20 15:51:19,174: ERROR/MainProcess] Process 'ForkPoolWorker-8' pid:5547 exited with 'signal 11 (SIGSEGV)' 

I am using Celery for my Django app task processing, and this issue seems to be related to forking on the M2 architecture.

I initially attempted to resolve the issue by exporting OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES, which seemed to work for a brief period. However, the problem has resurfaced, and this solution no longer has any effect.

It's worth noting that I am currently running MacOS Sonama 14.2 Beta on my machine.

Interestingly, I encountered and successfully resolved this problem once before while on the same beta program.

Any insights or suggestions on how to resolve this issue would be greatly appreciated.

1 Answer 1

6

Not sure if it will help in your case, but I also encountered issues using celery on my Mac with errors related to forking process

The solution that did work for me was to launch the worker with the --pool=solo option

Sign up to request clarification or add additional context in comments.

4 Comments

Very BIG thanks to you Jerome, I wish you saw the question sooner, can you explain why does it work or how did you come to this please?
I had my own issue where the proposed solution was also OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES, but it only resulted in another crash later during execution.
I then found out somewhere the proposition about the --pool=solo option, (celery.school/the-solo-worker-pool for the doc) basically without it the worker will fork itself when receiving a task (for multiprocessing) which doesn't seem to work very well on Mac
Great solutions, OBJC_DISABLE_INITIALIZE_FORK_SAFETY does not work on machine however, thanks for sharing your discoveries here.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.