falcon
falcon copied to clipboard
Falcon not working properly locally on MacOS (m1) in forked mode
Hello!
When I run be falcon host
& make a simple health check request I got this in .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg-1.5.4/lib/pg/connection.rb:690
:
And then have a server restart.
When I use be falcon serve -b http:/localhost:3000
, get this endless forked loop:
be falcon serve -b --threaded http:/localhost:3000
works fine. No problems inside Docker even with forked mode.
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
falcon (0.42.3)
Any thoughts, suggestions? How to correctly run the forked mode in MacOS (m1)?
Much appreciated in advance!
This can happen with some native extensions which load Objective-C. If you share the full backtrace we might be able to identify it.
Otherwise, for the sake of potentially avoiding this problem and definitely avoiding memory usage, try adding all your core gems to the preload group:
# gems.rb or Gemfile:
group :preload do
# e.g.
gem 'rails'
end
Thanks, @ioquatix for the quick reply! I've attached the example of the full trace. trace.txt
Also tried to use group :preload
- didn't help.
Make sure the pg
gem is in the preload group. Can you share what your preload group contains?
Local core-lib gem has pg inside (also the main stack - rails, etc.), but I've also tried to install the fresh one...
By the way - I have my db inside docker container (only the app is running locally for this case), maybe this is a reason?!
Okay, thanks, I'll try to reproduce this.
Thank you!
For postgres related seg fault, sometimes following helps:
export PGGSSENCMODE="disable"