Open belm0 opened 1 year ago
presumably related to this log:
objc[2865]: +[__NSTimeZone initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
I couldn't naively reproduce it locally.
It appears to be coming from grpc, but is not considered a grpc bug per se. It generally falls under "don't use os.fork() on macOS".
We could disable the mac safeguard with OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
(see https://hynek.me/til/rq-macos/)
Recent Python versions don't use fork()
on macOS by default, but I had the tests opt-in to it previously (9b59b66) due to another issue:
# work around pickle issue on macOS
if sys.platform == 'darwin':
multiprocessing = multiprocessing.get_context('fork')
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
does not seem to work. I tried setting it both from the test module, and from the pytest
invocation.
The best way to resolve this, though it needs significant test refactoring:
# TODO: there is no reason to run the server as a separate process...
# just use serve_async().
https://github.com/python-trio/purerpc/actions/runs/4158772667/jobs/7194217372