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 1723631 - 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 DUPLICATE of bug 1723632
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Jan Hutař
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-25 03:22 UTC by Hao Chang Yu
Modified: 2019-06-25 11:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-25 11:07:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Hao Chang Yu 2019-06-25 03:22:13 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 1 Hao Chang Yu 2019-06-25 11:07:29 UTC
Created a duplicate bug by accident so close it.

*** This bug has been marked as a duplicate of bug 1723632 ***


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