Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure we reflect on execution failure #700

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

mhenrixon
Copy link
Owner

@mhenrixon mhenrixon commented Apr 5, 2022

It will be useful for debugging like below:

SidekiqUniqueJobs.reflect do |on|
  on.duplicate do |item|
    keys = Sidekiq.redis(&:keys)

    Rails.logger.error(
      <<~EOS.squish
        Duplicate lock: #{item}. The following keys are present in redis: [#{keys.join(',')}]
      EOS
    )
  end

  on.execution_failed do |item|
    keys = Sidekiq.redis(&:keys)

    Rails.logger.error(
      <<~EOS.squish
        Failed to execute: #{item}. The following keys are present in redis: [#{keys.join(',')}]
      EOS
    )
  end
end

Signed-off-by: mhenrixon [email protected]

@mhenrixon mhenrixon self-assigned this Apr 5, 2022
Will be useful for debugging like below

```ruby
SidekiqUniqueJobs.reflect do |on|
  on.duplicate do |item|
    keys = Sidekiq.redis(&:keys)

    Rails.logger.error(
      <<~EOS.squish
        Duplicate lock: {item}". The following keys are present in redis: [#{keys.join(',')}]
      EOS
    )
  end

  on.execution_failed do |item|
    keys = Sidekiq.redis(&:keys)

    Rails.logger.error(
      <<~EOS.squish
        Failed to execute: #{item}". The following keys are present in redis: [#{keys.join(',')}]
      EOS
    )
  end
end
```

Signed-off-by: mhenrixon <[email protected]>
@mhenrixon mhenrixon force-pushed the hotfix/reflect-on-execution-failure branch from 2d8ca53 to d8f3bc8 Compare April 5, 2022 18:30
@mhenrixon mhenrixon merged commit 7affb83 into main Apr 5, 2022
@delete-merged-branch delete-merged-branch bot deleted the hotfix/reflect-on-execution-failure branch April 5, 2022 18:34
@mhenrixon mhenrixon restored the hotfix/reflect-on-execution-failure branch April 5, 2022 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant