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

run exits shortly after startup #41

Open
sentience opened this issue Oct 23, 2023 · 2 comments
Open

run exits shortly after startup #41

sentience opened this issue Oct 23, 2023 · 2 comments

Comments

@sentience
Copy link
Member

sentience commented Oct 23, 2023

In Murmur, running event_framework in the foreground causes the server to be killed shortly after startup:

> bin/projectors run
⋮
[1]    55389 killed     bin/projectors run

but starting it to run in the background keeps the server running successfully:

> bin/projectors start
⋮
murmur_projectors: process with pid 55871 started.

> bin/projectors status
⋮
murmur_projectors: running [pid 55871]

Update: The background process is not actually running successfully; it's just continually crashing and restarting. From the log file:

Domains::SurveyDesign::Projectors::SectionCodesCommandProjector
objc[19301]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[19301]: +[__NSCFConstantString 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, [2023-10-24T12:29:44.209171 #16381]  INFO -- : Domains::SurveyDesign::Projectors::SectionCodesCommandProjector terminated
E, [2023-10-24T12:29:44.211669 #16381] ERROR -- : Restarting
@sentience
Copy link
Member Author

sentience commented Oct 24, 2023

A couple of potential fixes here: rails/rails#38560

Update: Tried them without success.

@sentience
Copy link
Member Author

sentience commented Oct 24, 2023

OK, managed to get the Murmur projectors running using the OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES work-around described for macOS forking issues in a few places:

> spring stop
Spring is not running

> export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

> tail -f log/murmur_projectors.log &
⋮ log output begins

> bin/projectors start
⋮
murmur_projectors: process with pid 49445 started.

⋮ log output shows projectors running normally

> bin/projectors stop
⋮ log output shows projectors shutting down normally
murmur_projectors: process with pid 49445 successfully stopped.

> kill %1
[1]  + 49226 terminated  tail -f log/murmur_projectors.log  

The process still crashes (with no apparent error message) when not launched as a daemon:

> spring stop
Spring is not running

> export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

> bin/projectors run
⋮
[1]    55389 killed     bin/projectors run

If we can't find a fix for this, we should probably update Murmur's Procfile and setup instructions to run the projectors manually as daemons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant