You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Logs produced within the Middleware Logging context can contain an empty string as a key for jobs without "lock" key set in the job_hash. "" as a key within the log context at the moment is causing these logs to not be able to be ingested into our logging backend (Elasticsearch).
Expected behavior
Logs produced within the Middleware Logging context properly sets the lock type used within the log context.
Current behavior
Logs produced within the Middleware Logging context includes "" => digest but doesn't include any context on what lock is being used.
Additional context
The unique_disabled? check will return true, even if item[LOCK] is false, if the job class' sidekiq_options contain a lock.
Describe the bug
Logs produced within the Middleware Logging context can contain an empty string as a key for jobs without
"lock"
key set in the job_hash.""
as a key within the log context at the moment is causing these logs to not be able to be ingested into our logging backend (Elasticsearch).Expected behavior
Logs produced within the Middleware Logging context properly sets the lock type used within the log context.
Current behavior
Logs produced within the Middleware Logging context includes
"" => digest
but doesn't include any context on what lock is being used.Additional context
The unique_disabled? check will return true, even if
item[LOCK]
is false, if the job class' sidekiq_options contain alock
.However, the middleware logging context, called right after, assumes that
item[LOCK]
is set, and uses it as the key within the logging_context methodTwo possible solutions for this bug:
item[LOCK]
is nil.prepare
the job.My vote would be to go with Solution 2 as I could forsee other bugs coming up due to an assumption that
item[LOCK]
exists.PR for Solution 2, but happy to hear other possible solutions.
The text was updated successfully, but these errors were encountered: