Project

General

Profile

Bug #24763

Any error in CreateRssNotifications still marks the task as success and it doesn't re-schedule next event

Added by Ivan Necas 4 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Notifications
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

How to reproduce:

1. simulate error during the rss notification (add raise 'error' to https://github.com/theforeman/foreman/blob/44539bfc73f1c36e57985707032a1c91160af799/app/jobs/create_rss_notifications.rb#L8)
2. restart the dynflowd (or web server in case of development)
3. notice that the "Create RSS notifications" (when foreman-tasks is present) in still in stopped/success
4. further notice, there is not next task planned for the next check

It turns out the active_job is not handling `after_perform` callback when rescue bock is triggered, see https://github.com/rails/rails/blob/v5.2.0/activejob/lib/active_job/execution.rb#L33-L43


Related issues

Related to foreman-tasks - Bug #24761: Don't pause on active jobs tasksClosed

Associated revisions

Revision f4f5e16e (diff)
Added by Ivan Necas 4 months ago

Fixes #24763 - ensure reschedule rss notification on error

ActiveJob's after_perform doesn't run on any error: the rescue_from is
run after the callbacks. Also, the rescue_from is hiding the errors from
the task details when foreman-tasks is present: re-raising the error
after logging should be better.

History

#1 Updated by Ivan Necas 4 months ago

  • Related to Bug #24761: Don't pause on active jobs tasks added

#2 Updated by Ivan Necas 4 months ago

  • Bugzilla link set to 1623151

#3 Updated by The Foreman Bot 4 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6016 added

#4 Updated by Ivan Necas 4 months ago

  • Status changed from Ready For Testing to Closed

#5 Updated by Marek Hulán 4 months ago

  • Fixed in Releases 1.20.0 added

#6 Updated by Tomer Brisker 2 months ago

  • Category set to Notifications

Also available in: Atom PDF