Class EC2FleetAutoResubmitComputerLauncher

All Implemented Interfaces:
ExtensionPoint, Describable<ComputerLauncher>

@ThreadSafe public class EC2FleetAutoResubmitComputerLauncher extends DelegatingComputerLauncher
The EC2FleetAutoResubmitComputerLauncher is responsible for controlling: * how EC2FleetNodeComputers are launched * how EC2FleetNodeComputers 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()

  • Constructor Details

    • EC2FleetAutoResubmitComputerLauncher

      public EC2FleetAutoResubmitComputerLauncher(ComputerLauncher launcher)
  • Method Details

    • afterDisconnect

      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.

      Overrides:
      afterDisconnect in class DelegatingComputerLauncher
      Parameters:
      computer - computer
      listener - listener