Bug 833547 - make agent shutdown timeout configurable
Summary: make agent shutdown timeout configurable
Keywords:
Status: POST
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Josejulio Martínez
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-19 18:25 UTC by Charles Crouch
Modified: 2024-03-04 13:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Charles Crouch 2012-06-19 18:25:12 UTC
(1:00:30 PM) mazz: ips: I can't remember if there is "pull the pin" suicide code in that shutdown hook
(1:00:48 PM) mazz: by that I mean, it tries to kindly wait, but if the threads don't die, we eventually call System.exit()
(1:00:56 PM) mazz: is that the 100s timeout you are talking about?
(1:01:18 PM) mazz:             // set our timebomb to ensure the agent dies
(1:01:18 PM) mazz:             spawnKillThread(1000L * 60 * 5);
(1:01:41 PM) mazz:     /**
(1:01:41 PM) mazz:      * If something goes wrong and the VM does not die on its own when we think it should,
(1:01:41 PM) mazz:      * the thread created by this method will explicitly kill the VM.
(1:01:41 PM) mazz:      * Calling this method sets a timebomb that will kill the VM after a timer runs out.
(1:01:41 PM) mazz:      * There is no way to stop this timebomb short of performing 007-type heroics.
(1:01:42 PM) mazz:      * 
(1:01:42 PM) mazz:      * @param doomsday the number of milliseconds that the VM has left to live; once this
(1:01:43 PM) mazz:      *        time expires, a kill thread will execute System.exit(0).
(1:01:43 PM) mazz:      */
(1:01:44 PM) mazz:     public void spawnKillThread(final long doomsday) {
(1:01:50 PM) mazz: so after 5 minutes, the agent should eventually die
(1:02:28 PM) mazz: during shutdown, we should see a daemon thread named "RHQ Agent Kill Thread" in the thread dump
(1:03:00 PM) mazz: so it seems to me that no more than 5m should elapse before the agent VM process dies

spawnKillThread(1000L * 60 * 5) should be configurable if people want to change this behaviour, but keep its current default.

Comment 2 Josejulio 2015-10-26 22:35:16 UTC
Made the agent shutdown time configurable: https://github.com/rhq-project/rhq/pull/191

Comment 3 Josejulio Martínez 2016-01-25 17:20:03 UTC
commit cb99af60bececc64eba8b3ed12621d0028010755
Author: Josejulio Martínez Magaña <jmartine>
Date:   Mon Oct 26 14:41:37 2015 -0600

    Bug 833547 - make agent shutdown timeout configurable
    
    Takes the configuration from AgentConfiguration.
    Created the defaults in AgentConfigurationConstants.
    The configuration is taken from the entry: "rhq.agent.agent-update.exit-timeout-msecs".

Comment 4 Mike McCune 2016-03-28 22:47:43 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions


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