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

Improve enqueue_retry.active_job message #33972

Merged
merged 1 commit into from Oct 30, 2018

Commits on Sep 24, 2018

  1. Improve enqueue_retry.active_job message

    Since rails#33751 was added `enqueue_retry.active_job` instrumentation to
    the `retry_on` method, then rails#33897 moved the instrumentation to `retry_job`
    method in order to ensure that this method publish `enqueue_retry.active_job`
    notification too.
    See related discussion rails#33751 (comment)
    
    Since `enqueue_retry.active_job` moved to `retry_job`, there is no guarantee
    that payload of `enqueue_retry.active_job` would have `:error`.
    See test `LoggingTest#test_enqueue_retry_logging_on_retry_job` as
    example of that case.
    
    Related to rails#33897 (comment)
    
    I think we can improve notification of `enqueue_retry.active_job`:
    
    - If there is no `event.payload[:error]`, then publish like
      "Retrying RescueJob in 3 seconds." only.
    - If `event.payload[:wait]` is `nil`, then publish
      "Retrying RescueJob in 0 seconds." instead of "Retrying RescueJob in nil seconds."
    - If there is `event.payload[:error]`, then publish
      "Retrying RescueJob in 3 seconds, due to a DefaultsError.".
    - Change the type of the message from `error` to `info.`
    
    Also, this commit removes part of messages - "The original exception was #{ex.cause.inspect}."
    of `enqueue_retry.active_job`, `retry_stopped.active_job`, and `discard.active_job` since I
    haven't found it useful. Please let me know whether you agree with that?
    bogdanvlviv committed Sep 24, 2018
    Configuration menu
    Copy the full SHA
    b0f2f5e View commit details
    Browse the repository at this point in the history