Package hudson.plugins.ec2
Class EC2SpotInterruptionMonitor
java.lang.Object
java.util.TimerTask
hudson.triggers.SafeTimerTask
hudson.model.PeriodicWork
hudson.plugins.ec2.EC2SpotInterruptionMonitor
- All Implemented Interfaces:
ExtensionPoint,Runnable
Retires spot agents that EC2 has given notice on.
An interrupted instance has about two minutes left. Work handed to it in that window is work that will be lost, so an agent under notice is taken out of service straight away and terminated once whatever it was already running has finished. A build that is already under way cannot be saved, but nothing new needs to be thrown after it.
The notice is read from the instance rather than from EC2. It is the same signal AWS documents for the purpose, it arrives without waiting for an API to catch up, and asking costs nothing that counts against an API limit, which matters when the question is asked of every agent every few seconds. An on-demand instance simply answers that there is no notice.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.triggers.SafeTimerTask
SafeTimerTask.ExceptionRunnableNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.PeriodicWork
DAY, HOUR, logger, MIN -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class hudson.model.PeriodicWork
all, getInitialDelay, initMethods inherited from class hudson.triggers.SafeTimerTask
getLogsRoot, of, runMethods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
Constructor Details
-
EC2SpotInterruptionMonitor
public EC2SpotInterruptionMonitor()
-
-
Method Details
-
getRecurrencePeriod
public long getRecurrencePeriod()- Specified by:
getRecurrencePeriodin classPeriodicWork
-
doRun
protected void doRun()- Specified by:
doRunin classSafeTimerTask
-