Enable 5 lines of Sidekiq backtrace lines to aid in debugging
Customers often have Sidekiq jobs that failed without much context. Without Sentry, there's no way to tell where these exceptions were hit. Adding in additional lines adds a bit more Redis storage overhead. This commit adds in backtrace logging for workers that delete groups/projects and import/export projects. Closes #27626
This commit is contained in:
parent
c842e29aad
commit
32b688e785
6 changed files with 13 additions and 0 deletions
8
app/workers/concerns/exception_backtrace.rb
Normal file
8
app/workers/concerns/exception_backtrace.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Concern for enabling a few lines of exception backtraces in Sidekiq
|
||||
module ExceptionBacktrace
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
sidekiq_options backtrace: 5
|
||||
end
|
||||
end
|
|
@ -1,6 +1,7 @@
|
|||
class GroupDestroyWorker
|
||||
include Sidekiq::Worker
|
||||
include DedicatedSidekiqQueue
|
||||
include ExceptionBacktrace
|
||||
|
||||
def perform(group_id, user_id)
|
||||
begin
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
class NamespacelessProjectDestroyWorker
|
||||
include Sidekiq::Worker
|
||||
include DedicatedSidekiqQueue
|
||||
include ExceptionBacktrace
|
||||
|
||||
def self.bulk_perform_async(args_list)
|
||||
Sidekiq::Client.push_bulk('class' => self, 'queue' => sidekiq_options['queue'], 'args' => args_list)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
class ProjectDestroyWorker
|
||||
include Sidekiq::Worker
|
||||
include DedicatedSidekiqQueue
|
||||
include ExceptionBacktrace
|
||||
|
||||
def perform(project_id, user_id, params)
|
||||
project = Project.find(project_id)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
class ProjectExportWorker
|
||||
include Sidekiq::Worker
|
||||
include DedicatedSidekiqQueue
|
||||
include ExceptionBacktrace
|
||||
|
||||
sidekiq_options retry: 3
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ class RepositoryImportWorker
|
|||
|
||||
include Sidekiq::Worker
|
||||
include DedicatedSidekiqQueue
|
||||
include ExceptionBacktrace
|
||||
|
||||
sidekiq_options status_expiration: StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION
|
||||
|
||||
|
|
Loading…
Reference in a new issue