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

Fix Active Job log message to correctly report a job failed to enqueue when the adapter raises an ActiveJob::EnqueueError #47865

Merged
merged 1 commit into from Sep 5, 2023

Conversation

bensheldon
Copy link
Contributor

@bensheldon bensheldon commented Apr 5, 2023

Motivation / Background

When an Active Job adapter uses the ActiveJob::EnqueueError feature introduced in #41191, the log message incorrectly reports that the job was successfully enqueued. This fixes that by using the pre-existing failed-to-enqueue message when job.enqueue_error is present.

It would be really nice if this was backported as a bugfix to Rails 7.0, but I understand if the log message being incorrect is pretty minor.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

activejob/CHANGELOG.md Outdated Show resolved Hide resolved
@bensheldon bensheldon changed the title Fix ActiveJob log message to correctly report a job failed to enqueue when the adapter raises an ActiveJob::EnqueueError Fix Active Job log message to correctly report a job failed to enqueue when the adapter raises an ActiveJob::EnqueueError Apr 5, 2023
@etiennebarrie
Copy link
Contributor

LGTM it just needs a rebase

@bensheldon
Copy link
Contributor Author

Rebased 🎸

…e when the adapter raises an `ActiveJob::EnqueueError`
@kamipo kamipo merged commit b32c8a0 into rails:main Sep 5, 2023
3 of 4 checks passed
@bensheldon bensheldon deleted the enqueue-error-message branch September 5, 2023 03:18
@bensheldon
Copy link
Contributor Author

Thank you 🙏

kamipo added a commit that referenced this pull request Sep 5, 2023
Fix Active Job log message to correctly report a job failed to enqueue when the adapter raises an `ActiveJob::EnqueueError`
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.

None yet

4 participants