Git Product home page Git Product logo

Comments (12)

kyrylo avatar kyrylo commented on August 15, 2024

Hi @renatolond! I cannot reproduce the issue with the steps you provided. I start the app with rackup and it works as expected (the server starts listening to connections).

from airbrake-ruby.

renatolond avatar renatolond commented on August 15, 2024

@kyrylo Sorry, forgot to add this to the steps, the issue happens when starting falcon with the way recommended in the docs:

bundle exec falcon serve -c config.ru

I can confirm that with rackup I have no issues here either

from airbrake-ruby.

kyrylo avatar kyrylo commented on August 15, 2024

Thanks for the clarification but I still cannot reproduce this.

I copied the examples directory outside the falcon project so that there's no .git folder available anywhere on the path. I also added a Gemfile with falcon and local airbrake-ruby. The server starts as expected.

screenshot

1

from airbrake-ruby.

renatolond avatar renatolond commented on August 15, 2024

Oh, that's odd. Maybe it's an OS thing? My setup seems very similar to yours, but I still have the error (I also created a new folder, not in a git repo to be sure)

image
image

I'm running Arch Linux here, on Linux 5.16.14-arch1-1

from airbrake-ruby.

kyrylo avatar kyrylo commented on August 15, 2024
  1. What's your Ruby version?
  2. Do you have git installed and is it in your PATH?

from airbrake-ruby.

renatolond avatar renatolond commented on August 15, 2024
  1. I'm using ruby 3.1.1 here
  2. I do:
$ git --version
git version 2.35.1

from airbrake-ruby.

kyrylo avatar kyrylo commented on August 15, 2024

Can you try again with this line: Airbrake.delete_filter(Airbrake::Filters::GitRepositoryFilter) (after the configure call)? Will the error go away?

from airbrake-ruby.

renatolond avatar renatolond commented on August 15, 2024

No, I tried both inside the block and after the configure and I have the same error. It seems to happen while it's added.

if I comment it out in lib/airbrake-ruby/config/processor.rb it seems to go away though

from airbrake-ruby.

kyrylo avatar kyrylo commented on August 15, 2024

So it fails on line 52:

def detect_git_version
return unless which('git')
Gem::Version.new(`git --version`.split[2])
end

On line 50 we have a check that prevents line 52 executing if git is not available. Line 52 calls fork() and EAGAIN errors means (according to OSX's man fork):

ERRORS
fork() will fail and no child process will be created if:

 [EAGAIN]           The system-imposed limit on the total number of processes under execution would be exceeded.  This limit is configuration-
                    dependent.

 [EAGAIN]           The system-imposed limit MAXUPRC (⟨sys/param.h⟩) on the total number of processes under execution by a single user would be
                    exceeded.

Do you start your falcon server in a container? Perhaps, you could tweak some of the limits so that spawning a new process is allowed?

from airbrake-ruby.

renatolond avatar renatolond commented on August 15, 2024

It was not in a container, I was testing a functionality locally so I was running on my dev env directly. As far as I know I don't have any limits that would block creation of the new processes:

$ ulimit -a
-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             8192
-c: core file size (blocks)         unlimited
-m: resident set size (kbytes)      unlimited
-u: processes                       62621
-n: file descriptors                1024
-l: locked-in-memory size (kbytes)  8192
-v: address space (kbytes)          unlimited
-x: file locks                      unlimited
-i: pending signals                 62621
-q: bytes in POSIX msg queues       819200
-e: max nice                        0
-r: max rt priority                 0
-N 15:                              unlimited

Not sure if one of them could be responsible for this

I also tried starting falcon in different ways, even with just one instance (with -n 1) the problem is still there:

$ bundle exec  falcon serve -c config.ru -n 1
  0.0s     info: Falcon::Command::Serve [oid=0x7a8] [ec=0x7bc] [pid=6913] [2022-04-11 08:34:39 -0300]
               | Falcon v0.39.2 taking flight! Using Async::Container::Forked {:count=>1}.
               | - Binding to: #<Falcon::Endpoint https://localhost:9292/ {}>
               | - To terminate: Ctrl-C or kill 6913
               | - To reload configuration: kill -HUP 6913
 0.03s     info: Falcon::Controller::Serve [oid=0x7d0] [ec=0x7bc] [pid=6913] [2022-04-11 08:34:39 -0300]
               | Starting Falcon Server on https://localhost:9292/
 0.08s    error: Async::Task [oid=0x7e4] [ec=0x7f8] [pid=6914] [2022-04-11 08:34:39 -0300]
               |   Errno::EAGAIN: Resource temporarily unavailable
               |   → /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/bundler/gems/airbrake-ruby-f72c428351b2/lib/airbrake-ruby/filters/git_repository_filter.rb:52 in ``'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/bundler/gems/airbrake-ruby-f72c428351b2/lib/airbrake-ruby/filters/git_repository_filter.rb:52 in `detect_git_version'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/bundler/gems/airbrake-ruby-f72c428351b2/lib/airbrake-ruby/filters/git_repository_filter.rb:14 in `initialize'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/bundler/gems/airbrake-ruby-f72c428351b2/lib/airbrake-ruby/config/processor.rb:66 in `new'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/bundler/gems/airbrake-ruby-f72c428351b2/lib/airbrake-ruby/config/processor.rb:66 in `block in add_filters'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/bundler/gems/airbrake-ruby-f72c428351b2/lib/airbrake-ruby/config/processor.rb:63 in `each'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/bundler/gems/airbrake-ruby-f72c428351b2/lib/airbrake-ruby/config/processor.rb:63 in `add_filters'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/bundler/gems/airbrake-ruby-f72c428351b2/lib/airbrake-ruby.rb:133 in `configure'
               |     config.ru:10 in `block in <main>'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:116 in `eval'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:116 in `new_from_string'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:105 in `load_file'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:66 in `parse_file'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/gems/falcon-0.39.2/lib/falcon/command/serve.rb:98 in `load_app'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/gems/falcon-0.39.2/lib/falcon/controller/serve.rb:60 in `load_app'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/gems/falcon-0.39.2/lib/falcon/controller/serve.rb:89 in `block (2 levels) in setup'
               |     /home/renatolond/.rvm/rubies/ruby-3.1.1-jemalloc/lib/ruby/gems/3.1.0/gems/async-2.0.1/lib/async/task.rb:258 in `block in schedule'
 0.09s     info: Async::Container::Forked [oid=0x80c] [ec=0x820] [pid=6913] [2022-04-11 08:34:39 -0300]
               | #<Async::Container::Process Falcon Server> exited with pid 6914 exit 0
 0.16s    error: Async::Task [oid=0x834] [ec=0x848] [pid=6916] [2022-04-11 08:34:39 -0300]
               |   Errno::EAGAIN: Resource temporarily unavailable

from airbrake-ruby.

kyrylo avatar kyrylo commented on August 15, 2024

I published a fix: #684
Could you please give it a go, @renatolond?

from airbrake-ruby.

renatolond avatar renatolond commented on August 15, 2024

Yep, starting fine on that ref :) thanks!

bundle exec  falcon serve -c config.ru -n 1
  0.0s     info: Falcon::Command::Serve [oid=0x7a8] [ec=0x7bc] [pid=27800] [2022-04-11 11:26:21 -0300]
               | Falcon v0.39.2 taking flight! Using Async::Container::Forked {:count=>1}.
               | - Binding to: #<Falcon::Endpoint https://localhost:9292/ {}>
               | - To terminate: Ctrl-C or kill 27800
               | - To reload configuration: kill -HUP 27800
 0.03s     info: Falcon::Controller::Serve [oid=0x7d0] [ec=0x7bc] [pid=27800] [2022-04-11 11:26:21 -0300]
               | Starting Falcon Server on https://localhost:9292/
 0.07s     info: Async::Container::Process::Instance [oid=0x7e4] [ec=0x7f8] [pid=27801] [2022-04-11 11:26:21 -0300]
               | - Per-process status: kill -USR1 27801

from airbrake-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.