File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ ## Unreleased
2+
3+ ### Features
4+
5+ - Expose ` configuration.background_worker_max_queue ` to control thread pool queue size [ #2195 ] ( https://github.com/getsentry/sentry-ruby/pull/2195 )
6+
17## 5.15.0
28
39### Features
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ class BackgroundWorker
1313 attr_reader :logger
1414 attr_accessor :shutdown_timeout
1515
16+ DEFAULT_MAX_QUEUE = 30
17+
1618 def initialize ( configuration )
17- @max_queue = 30
1819 @shutdown_timeout = 1
1920 @number_of_threads = configuration . background_worker_threads
21+ @max_queue = configuration . background_worker_max_queue
2022 @logger = configuration . logger
2123 @debug = configuration . debug
2224 @shutdown_callback = nil
Original file line number Diff line number Diff line change @@ -40,6 +40,13 @@ class Configuration
4040 # @return [Integer]
4141 attr_accessor :background_worker_threads
4242
43+ # The maximum queue size for the background worker.
44+ # Jobs will be rejected above this limit.
45+ #
46+ # Default is {BackgroundWorker::DEFAULT_MAX_QUEUE}.
47+ # @return [Integer]
48+ attr_accessor :background_worker_max_queue
49+
4350 # a proc/lambda that takes an array of stack traces
4451 # it'll be used to silence (reduce) backtrace of the exception
4552 #
@@ -329,6 +336,7 @@ def initialize
329336 self . app_dirs_pattern = nil
330337 self . debug = false
331338 self . background_worker_threads = Concurrent . processor_count
339+ self . background_worker_max_queue = BackgroundWorker ::DEFAULT_MAX_QUEUE
332340 self . backtrace_cleanup_callback = nil
333341 self . max_breadcrumbs = BreadcrumbBuffer ::DEFAULT_SIZE
334342 self . breadcrumbs_logger = [ ]
You can’t perform that action at this time.
0 commit comments