Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1723632 - When restarting foreman-tasks, long running tasks got forcefully killed after 20 seconds of wait.
Summary: When restarting foreman-tasks, long running tasks got forcefully killed after...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.11.0
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
: 1723631 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-25 03:23 UTC by Hao Chang Yu
Modified: 2024-12-20 18:51 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:27:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27123 0 Normal New When restarting foreman-tasks, long running tasks got forcefully killed after 20 seconds of wait 2020-11-20 22:43:17 UTC
Github Dynflow dynflow pull 327 0 None closed Fixes #27123 - Make "force_kill_waittime" option adjustable 2020-11-20 22:43:18 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:28:06 UTC

Description Hao Chang Yu 2019-06-25 03:23:16 UTC
Description of problem:
In some cases, long running task like LOCE task and Katello Event Monitor task in a heavy loaded Satellite can get kill forcefully when restarting the foreman-tasks.

After restarting the foreman-tasks, these tasks will get invalidated and enter paused/error state due to Abnormal termanation like below.
---------------------------
6b764da1-7575-4b4b-a4ce-cb7b42bd8ae1,ForemanTasks::Task::DynflowTask,Actions::Candlepin::ListenOnCandlepinEvents,2019-06-23 07:53:31,,paused,error,97a1929c-1d6d-4ab2-a904-3338065334b0,,2019-06-23 07:53:31.69066

07:55:29.880357,118.021665403,87.6361777380003,0.5,1,Dynflow::ExecutionPlan::Steps::RunStep,"{""class"":""Dynflow::ExecutionPlan::Steps::Error"",""exception_class"":""StandardError"",""message"":""Abnormal termination (previous state: running)""
---------------------------


Dynflow wait for 20 seconds and then kill the executors if the tasks still haven't finished by that time.
---------------------------
Jun 24 14:33:09 my-satellite dynflowd: Dynflow Executor: stop in progress
Jun 24 14:33:09 my-satellite dynflowd: dynflow_executor: trying to stop process with pid 30687...
Jun 24 14:33:09 my-satellite dynflowd: dynflow_executor: trying to stop process with pid 30699...
Jun 24 14:33:29 my-satellite dynflowd: dynflow_executor: process with pid 30687 won't stop, we forcefully kill it...
Jun 24 14:33:29 my-satellite dynflowd: dynflow_executor: process with pid 30699 won't stop, we forcefully kill it...
---------------------------

Since that we are setting the systemd TimeoutSec to 90 seconds, Dynflow should also increase the "force_kill_waittime" of ruby daemon to some value below 90 seconds.e.g 60 seconds.

cat /usr/lib/systemd/system/dynflowd.service
[Service]
Type=forking
User=foreman
TimeoutSec=90      <======================= Systemd timeout
WorkingDirectory=/usr/share/foreman
ExecStart=/usr/sbin/dynflowd start
ExecStop=/usr/sbin/dynflowd stop
EnvironmentFile=-/etc/sysconfig/dynflowd


daemons-1.2.3/lib/daemons/application.rb
    def initialize(group, add_options = {}, pid = nil)
      @group = group
      @options = group.options.dup
      @options.update(add_options)

      @dir_mode = @dir = @script = nil

      @force_kill_waittime = @options[:force_kill_waittime] || 20 <========== Default 20 seconds



Suggest to make the "force_kill_waittime" an option in Dynflow so that user can adjust it.

Comment 4 Hao Chang Yu 2019-06-25 11:07:29 UTC
*** Bug 1723631 has been marked as a duplicate of this bug. ***

Comment 5 Eric Helms 2021-11-04 13:15:44 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/27123 has been resolved.

Comment 6 Peter Ondrejka 2022-02-11 12:24:46 UTC
Verified on Satellite 7.0 snap 8, the force_kill_waittime option has been added with default 60 and is adjustable

Comment 9 errata-xmlrpc 2022-07-05 14:27:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498


Note You need to log in before you can comment on or make changes to this bug.