Issue Description
When being ran in classic mode and without config.ru (e.g. bundle exec ruby app.rb), Sinatra apps will be initialized at the end of the Ruby script by a at_exit callback. And that means that the SDK's at_exit callback will also be called:
|
at_exit do |
|
@session_flusher&.kill |
|
@background_worker.shutdown |
|
end |
So when app.rb is loaded, the SDK's background worker is also disabled 🙈 Therefore, no event will be sent by the SDK.
Reproduction Steps
Script
# app.rb
require 'sinatra'
require 'sentry-ruby'
Sentry.init do |config|
config.dsn = 'DSN'
end
use Sentry::Rack::CaptureExceptions
get "/" do
raise "foo"
end
Command
$ bundle exec ruby app.rb
Expected Behavior
Errors will be reported.
Actual Behavior
Errors are not reported because the background worker is shut down unexpectedly.
Ruby Version
3.1.0
SDK Version
5.2.1 & master
Integration and Its Version
No response
Sentry Config
No response
Issue Description
When being ran in classic mode and without
config.ru(e.g.bundle exec ruby app.rb), Sinatra apps will be initialized at the end of the Ruby script by aat_exitcallback. And that means that the SDK'sat_exitcallback will also be called:sentry-ruby/sentry-ruby/lib/sentry-ruby.rb
Lines 216 to 219 in 0f66522
So when
app.rbis loaded, the SDK's background worker is also disabled 🙈 Therefore, no event will be sent by the SDK.Reproduction Steps
Script
Command
Expected Behavior
Errors will be reported.
Actual Behavior
Errors are not reported because the background worker is shut down unexpectedly.
Ruby Version
3.1.0
SDK Version
5.2.1 & master
Integration and Its Version
No response
Sentry Config
No response