dead_bro 0.2.32 → 0.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/dead_bro.rb CHANGED
@@ -30,6 +30,7 @@ module DeadBro
30
30
  autoload :MemoryDetails, "dead_bro/memory_details"
31
31
  autoload :Logger, "dead_bro/logger"
32
32
  autoload :WatchTracker, "dead_bro/watch_tracker"
33
+ autoload :Sanitizer, "dead_bro/sanitizer"
33
34
  begin
34
35
  require "dead_bro/railtie"
35
36
  rescue LoadError
@@ -37,6 +38,23 @@ module DeadBro
37
38
 
38
39
  class Error < StandardError; end
39
40
 
41
+ # What DeadBro code running inside the host's request or job — notification
42
+ # callbacks, middleware — rescues so it can never fail the host. Rails re-raises
43
+ # a notification listener's exception into the instrumented block, so a raise
44
+ # in a process_action callback turns the host's 200 into a 500.
45
+ #
46
+ # Deliberately not Exception: an asynchronous interrupt that happens to land
47
+ # while our code runs (Timeout, Rack::Timeout, Sidekiq::Shutdown, Interrupt)
48
+ # must still reach the host, or its timeout/shutdown handling silently stops
49
+ # working. These are the errors our own code can raise synchronously.
50
+ #
51
+ # One gap remains: Timeout.timeout(sec, SomeStandardError) delivers a
52
+ # StandardError, so it is swallowed if it fires mid-callback — as it would be
53
+ # by any `rescue => e` in the host's own code, on every Ruby. Plain
54
+ # Timeout.timeout(sec) is not affected. Rescuing Exception wouldn't close that
55
+ # gap; it would only open the ones above.
56
+ CONTAINED_ERRORS = [StandardError, ScriptError, SystemStackError].freeze
57
+
40
58
  # Returned by DeadBro.analyze. sql_queries is intentionally omitted from
41
59
  # inspect/to_s/pretty_print to avoid bloating console output.
42
60
  # Access it explicitly via .sql_queries.
@@ -338,6 +356,7 @@ module DeadBro
338
356
  end
339
357
 
340
358
  local_sql_queries << {duration_ms: duration_ms, sql: normalized_sql, query_type: query_type}
359
+ rescue *DeadBro::CONTAINED_ERRORS
341
360
  end
342
361
  end
343
362
  rescue
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dead_bro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.32
4
+ version: 0.2.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emanuel Comsa
@@ -18,6 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - CHANGELOG.md
21
+ - FEATURES.md
21
22
  - README.md
22
23
  - lib/dead_bro.rb
23
24
  - lib/dead_bro/allocation_source_sampler.rb
@@ -53,6 +54,7 @@ files:
53
54
  - lib/dead_bro/monitor.rb
54
55
  - lib/dead_bro/railtie.rb
55
56
  - lib/dead_bro/redis_subscriber.rb
57
+ - lib/dead_bro/sanitizer.rb
56
58
  - lib/dead_bro/sql_subscriber.rb
57
59
  - lib/dead_bro/sql_tracking_middleware.rb
58
60
  - lib/dead_bro/subscriber.rb
@@ -80,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
82
  - !ruby/object:Gem::Version
81
83
  version: '0'
82
84
  requirements: []
83
- rubygems_version: 4.0.10
85
+ rubygems_version: 4.0.22
84
86
  specification_version: 4
85
87
  summary: Minimal APM for Rails apps.
86
88
  test_files: []