Details
-
Feature
-
Status: Released (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Current Situation
- If a long-running job does not perform any API calls, no data is sent over the network
- This might cause connection aborts due to idle timeouts configured by
- firewalls
- proxies
Desired Behavior
JobScheduler classic Agent can be configured to send a small keep-alive packet to JobScheduler Master to prevent connections from timing out by adding the following parameter to the <params> section of scheduler.xml:
<params> <param name="scheduler.agent.keep_alive" value="300"/> </params>
The value sets the interval in seconds between two keep-alive packets.
If the parameter is not set or if the value attribute is empty, no keep-alive packets will be sent.
Workarounds
The idle connection can be overcome by
- regularly calling API methods (only in jobs using the API)
- regularly logging to stdout (every log line to stdout is a log API call as well and makes use of the TCP connection)
- using one of the heartbeat scripts provided below
Heartbeat script for Linux Agents
Store the attached script heartbeat.sh in the file system of the Agent.
Configure long running job scripts to run the heartbeat script:
trap 'kill $(jobs -p)' EXIT
/path/to/heartbeat.sh &
#your scriptcode here...
Heartbeat script for Windows Agents
Store the attached script heartbeat.cmd in the file system of the Agent.
Configure long running job scripts to run the heartbeat script:
start /b C:\temp\heartbeat.cmd @rem your scriptcode here...
Don't use quotes in the start command, e.g. start /b "c:\my scripts\heartbeat.cmd".