@ThreadSafe public class EC2FleetAutoResubmitComputerLauncher extends DelegatingComputerLauncher
EC2FleetAutoResubmitComputerLauncher
is responsible for controlling:
* how EC2FleetNodeComputer
s are launched
* how EC2FleetNodeComputer
s connect to agents EC2FleetNode
This is wrapper for ComputerLauncher
to get notification when agent was disconnected
and automatically resubmit Queue.Task
if reason is unexpected termination
which usually means EC2 instance was interrupted.
This is optional feature, it's enabled by default, but could be disabled by
EC2FleetCloud.isDisableTaskResubmit()
DelegatingComputerLauncher.DescriptorImpl
ExtensionPoint.LegacyInstancesAreScopedToHudson
launcher
LIST
Constructor and Description |
---|
EC2FleetAutoResubmitComputerLauncher(ComputerLauncher launcher) |
Modifier and Type | Method and Description |
---|---|
void |
afterDisconnect(SlaveComputer computer,
TaskListener listener)
|
beforeDisconnect, getLauncher, launch
afterDisconnect, beforeDisconnect, checkJavaVersion, isLaunchSupported, launch
getDescriptor
public EC2FleetAutoResubmitComputerLauncher(ComputerLauncher launcher)
public void afterDisconnect(SlaveComputer computer, TaskListener listener)
ComputerLauncher.afterDisconnect(SlaveComputer, TaskListener)
EC2 Fleet plugin overrides this method to detect jobs which were failed because of EC2 instance was terminated/stopped. It could be manual stop or because of Spot marked. In all cases as soon as job aborted because of broken connection and agent is offline it will try to resubmit aborted job back to the queue, so user doesn't need to do that manually and another agent could take it.
Implementation details
There is no official recommendation about way how to resubmit job according to https://issues.jenkins-ci.org/browse/JENKINS-49707 moreover some of Jenkins code says it impossible.
We resubmit any active executables that were being processed by the disconnected node, regardless of why the node disconnected.
afterDisconnect
in class DelegatingComputerLauncher
computer
- computerlistener
- listenerCopyright © 2016–2023. All rights reserved.