Closed alilland closed 5 years ago
it appears that I am able to send simple GET requests with RestClient within the worker, but any post request is failing
__NSPlaceholderDictionary
is not a part of Sneakers, Bunny or any other dependency. In fact, the name strongly suggests this is a part of the Objective-C runtime/Foundation.
A quick search for the message (+[__NSPlaceholderDictionary 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.
) leads to this post about a Mac OS-specific behavior introduced in High Sierra.
According to the post above,
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
disables the safety mechanism that prevents Ruby from successfully executing fork(2)
.
The problematic interplay between threads and fork(2)
is nothing new (Passenger maintainers have written about it years ago). Their recommendation that
To guarantee that forking is safe, the application must not be running any threads at the point of fork (or the other threads must only be executing async-signal-safe code).
should generally true for Sneakers but only a thorough review can provide an informed answer. Those who feel interested in concurrency are welcome to conduct one. I personally have little time to dedicate to Sneakers and currently, it is best spent on pull request reviews and integration tests.
I get the following errors when my worker tries to make a post request, and sneakers just fails on the same message continually spinning up new workers and failing, where do I go from here?
Ruby Config / Launch file
./sneakers.rb
My worker
./workers/field_work_order_worker.rb
relevent model
./models/field_work_orders/field_work_order_model.rb