fix(emr): honour CancelSteps' StepCancellationOption, SIGTERM by default (#9139)

CancelSteps took no StepCancellationOption: a cancelled RUNNING step's
container was killed at once, which is TERMINATE_PROCESS. The
Management Guide's "Cancel steps" makes SEND_INTERRUPT the default:
"EMR sends a SIGTERM signal to the step", which may catch it "to
terminate descendant step processes or wait for them to complete";
with TERMINATE_PROCESS "EMR sends a SIGKILL signal to the step and all
its descendant processes which terminates them immediately".

With SEND_INTERRUPT the step's container now gets SIGTERM and the step
stays CANCEL_PENDING until its command ends on its own, CANCELLED then,
without its ActionOnFailure. A step's container runs under an init
process, as Docker's --init runs one, so that the signal reaches its
command: a container's first process ignores SIGTERM unless it handles
it. A step whose container is not running yet has nothing to
interrupt, and is stopped as before. TERMINATE_PROCESS kills it at
once, as every cancel did, with SIGKILL alone, as Docker's own stop
would send SIGTERM first and the init would pass it on; it also kills
a step a SEND_INTERRUPT cancel left running, and a cluster's end kills
such a step too. An option that is neither gets the framework's enum
message.

A CancelSteps request takes at most 100 steps from release 7.14.0, and
256 before it, as "With Amazon EMR releases 7.14.0 and later, the
maximum number of steps you can cancel per request is 100".
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-21 10:40:56 -04:00
1 parent 82bc86f7f3
commit 8a0112d9c5
11 files changed
+344 -43

No files matched your search

@@ -76,8 +76,11 @@ final class EmrClusterLifecycle {
/** {@code step} of {@code cluster} has just gone RUNNING. */
void start(EmrCluster cluster, EmrStep step, String region);
/** {@code step}, which was RUNNING, has just been cancelled. */
void stop(EmrStep step);
/**
* {@code step}, which was RUNNING, has just been cancelled: with {@code terminateProcess} its process is killed
* at once, and else sent SIGTERM and left to end.
*/
void stop(EmrStep step, boolean terminateProcess);
}
/**
@@ -171,9 +174,19 @@ final class EmrClusterLifecycle {
* ({@link #stepEnded}), and keeps its place among the running steps meanwhile: "Canceling a running step does
* not allow a pending step to start running, assuming no change to stepConcurrencyLevel". One that completes
* by time, nothing running it, is CANCELLED at once and makes room for the next PENDING one.
*
* <p>The Management Guide's "Cancel steps": with {@code SEND_INTERRUPT}, the default, "EMR sends a SIGTERM signal
* to the step", which may catch it "to terminate descendant step processes or wait for them to complete"; with
* {@code TERMINATE_PROCESS} ({@code terminateProcess}) "EMR sends a SIGKILL signal to the step and all its
* descendant processes which terminates them immediately". A step whose SEND_INTERRUPT cancel is pending is
* killed by a TERMINATE_PROCESS one.
*/
String cancel(EmrCluster cluster, EmrStep step, Instant now, String region) {
String cancel(EmrCluster cluster, EmrStep step, Instant now, String region, boolean terminateProcess) {
if (CANCEL_PENDING.equals(step.getState())) {
if (terminateProcess && step.isInterrupted()) {
step.setInterrupted(false);
execution.stop(step, true);
}
return null;
}
boolean running = RUNNING.equals(step.getState()) && cancelsRunningSteps(cluster.getReleaseLabel());
@@ -182,8 +195,9 @@ final class EmrClusterLifecycle {
}
if (running && !timed(step)) {
step.setState(CANCEL_PENDING);
step.setInterrupted(!terminateProcess);
events.queue(events.stepCancelPending(cluster, step, now), region);
execution.stop(step);
execution.stop(step, terminateProcess);
return null;
}
cancelStep(cluster, step, now, region);
@@ -334,6 +348,8 @@ final class EmrClusterLifecycle {
*/
void stepEnded(EmrCluster cluster, EmrStep step, String failure, Instant at, String region) {
if (CANCEL_PENDING.equals(step.getState())) {
// Its driver has ended, so there is nothing left to kill.
step.setInterrupted(false);
cancelStep(cluster, step, at, region);
runSteps(cluster, at, region);
return;
@@ -403,12 +419,14 @@ final class EmrClusterLifecycle {
}
private void cancelStep(EmrCluster cluster, EmrStep step, Instant at, String region) {
boolean running = RUNNING.equals(step.getState());
// Running, or left to end after a SIGTERM: a step its cluster's end cancels has its process killed.
boolean going = RUNNING.equals(step.getState()) || step.isInterrupted();
step.setState(CANCELLED);
step.setInterrupted(false);
step.setEndDateTime(at);
events.queue(events.stepStatusChange(cluster, step, CANCELLED), region);
if (running && !timed(step)) {
execution.stop(step);
if (going && !timed(step)) {
execution.stop(step, true);
}
}
@@ -307,8 +307,8 @@ public class EmrHandler {
private Response handleCancelSteps(JsonNode request) {
requireMembers(request, "StepIds");
List<EmrService.CancelStepInfo> infos = service.cancelSteps(
text(request, "ClusterId"), stringList(request.path("StepIds")));
List<EmrService.CancelStepInfo> infos = service.cancelSteps(text(request, "ClusterId"),
stringList(request.path("StepIds")), text(request, "StepCancellationOption"));
ObjectNode response = objectMapper.createObjectNode();
ArrayNode arr = response.putArray("CancelStepsInfoList");
for (EmrService.CancelStepInfo info : infos) {
@@ -241,11 +241,15 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
private static final long MAX_IDLE_TIMEOUT_SECONDS = 604_800;
// StepConcurrencyLevel: "You can specify a minimum of 1 step and a maximum of 256 steps" (ModifyCluster), "The
// maximum value is 256" (RunJobFlow). And "only 256 steps can be RUNNING or PENDING at any given time" (Management
// Guide), and "A maximum of 256 steps are allowed in each CancelSteps request". No source gives AWS's answer to
// any of them, so their words are Floci's.
// Guide), and "With Amazon EMR releases 7.14.0 and later, the maximum number of steps you can cancel per request
// is 100. With earlier releases, the maximum is 256 steps per request" ("Cancel steps"). No source gives AWS's
// answer to any of them, so their words are Floci's.
private static final int MAX_STEP_CONCURRENCY = 256;
private static final int MAX_ACTIVE_STEPS = 256;
private static final int MAX_CANCELLED_STEPS = 256;
private static final int MAX_CANCELLED_STEPS_FROM_7_14 = 100;
private static final String TERMINATE_PROCESS = "TERMINATE_PROCESS";
private static final List<String> STEP_CANCELLATION_OPTIONS = List.of("SEND_INTERRUPT", TERMINATE_PROCESS);
// A release label's major, minor and patch versions.
private static final Pattern RELEASE_VERSION = Pattern.compile("emr-(\\d{1,6})\\.(\\d{1,6})\\.(\\d{1,6})");
private static final int MAX_PORT = 65_535;
@@ -730,6 +734,19 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
public record CancelStepInfo(String stepId, String status, String reason) {}
public List<CancelStepInfo> cancelSteps(String clusterId, List<String> stepIds) {
return cancelSteps(clusterId, stepIds, null);
}
/**
* Cancels the steps with {@code option}, SEND_INTERRUPT (the default, for null) or TERMINATE_PROCESS, the model's
* StepCancellationOption ({@link EmrClusterLifecycle#cancel}).
*/
public List<CancelStepInfo> cancelSteps(String clusterId, List<String> stepIds, String option) {
if (option != null && !STEP_CANCELLATION_OPTIONS.contains(option)) {
throw SmithyValidationErrors.validationException(
SmithyValidationErrors.notInEnum(option, "stepCancellationOption", STEP_CANCELLATION_OPTIONS));
}
boolean terminateProcess = TERMINATE_PROCESS.equals(option);
return call(() -> {
EmrCluster cluster = requireCluster(clusterId);
// CancelSteps is "Available only in Amazon EMR versions 4.8.0 and later, excluding version 5.0.0".
@@ -737,15 +754,17 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
throw invalid("CancelSteps is available only in Amazon EMR versions 4.8.0 and later, excluding"
+ " version 5.0.0, and cluster " + clusterId + " runs " + cluster.getReleaseLabel() + ".");
}
if (stepIds.size() > MAX_CANCELLED_STEPS) {
throw invalid("A CancelSteps request can cancel at most " + MAX_CANCELLED_STEPS + " steps, and this"
+ " one names " + stepIds.size() + ".");
int most = releaseAtLeast(cluster.getReleaseLabel(), 7, 14, 0)
? MAX_CANCELLED_STEPS_FROM_7_14 : MAX_CANCELLED_STEPS;
if (stepIds.size() > most) {
throw invalid("A CancelSteps request can cancel at most " + most + " steps on release "
+ cluster.getReleaseLabel() + ", and this one names " + stepIds.size() + ".");
}
List<CancelStepInfo> result = new ArrayList<>();
for (String stepId : stepIds) {
EmrStep step = stepOf(cluster, stepId).orElse(null);
String refusal = step == null ? "Step does not exist."
: lifecycle.cancel(cluster, step, now(), regionOf(cluster));
: lifecycle.cancel(cluster, step, now(), regionOf(cluster), terminateProcess);
result.add(refusal == null
? new CancelStepInfo(stepId, "SUBMITTED", null)
: new CancelStepInfo(stepId, "FAILED", refusal));
@@ -2793,6 +2812,18 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
.filter(step -> EmrClusterLifecycle.RUNNING.equals(step.getState())).isPresent();
}
/**
* Whether a step's driver may go on, in its reset: RUNNING, or, once its driver runs, interrupted and free to end
* on its own. One interrupted before its driver started has no process to signal, so it does not start.
*/
private synchronized boolean mayGoOn(StepLaunch launch, boolean driverStarted) {
return launch.launchedIn() == generation && clusterStore.get(launch.clusterId())
.flatMap(cluster -> stepOf(cluster, launch.stepId()))
.filter(step -> EmrClusterLifecycle.RUNNING.equals(step.getState()) || (driverStarted
&& EmrClusterLifecycle.CANCEL_PENDING.equals(step.getState()) && step.isInterrupted()))
.isPresent();
}
// Whether a command's cluster still runs, in the reset it was handed off in.
private synchronized boolean commandGoing(CommandLaunch launch) {
return launch.launchedIn() == generation && clusterStore.get(launch.clusterId())
@@ -2882,7 +2913,7 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
executionRole(cluster, step, accountId), Map.of(), hive.arguments(), hive.runner(),
Duration.ZERO, EmrSparkSteps.logFolder(cluster, step), null,
EmrSparkSteps.hiveEnvironment(cluster.getConfigurations(), SNAPSHOT_MAPPER), List.of(),
storage, Map.of(), Map.of(), Map.of(), Map.of(), Map.of(), null);
storage, Map.of(), Map.of(), Map.of(), Map.of(), Map.of(), null).asInterruptible();
} else if (application == null && command == null) {
job = null;
} else {
@@ -2897,7 +2928,8 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
EmrSparkSteps.sparkLog4j2(cluster.getConfigurations(), SNAPSHOT_MAPPER),
EmrSparkSteps.mapredSite(cluster.getConfigurations(), SNAPSHOT_MAPPER),
EmrSparkSteps.hadoopLog4j(cluster.getConfigurations(), SNAPSHOT_MAPPER),
EmrSparkSteps.hadoopEnvironment(cluster.getConfigurations(), SNAPSHOT_MAPPER), null);
EmrSparkSteps.hadoopEnvironment(cluster.getConfigurations(), SNAPSHOT_MAPPER), null)
.asInterruptible();
}
StepLaunch launch = new StepLaunch(accountId, region, cluster.getId(), step.getId(), generation,
teardowns.get());
@@ -2908,8 +2940,12 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
}
@Override
public void stop(EmrStep step) {
sparkRunner.stop(step.getId());
public void stop(EmrStep step, boolean terminateProcess) {
if (terminateProcess) {
sparkRunner.stop(step.getId());
} else {
sparkRunner.interrupt(step.getId());
}
}
}
@@ -3926,7 +3962,8 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
@Override
public boolean cancelled() {
return teardowns.get() != launch.teardownsBefore()
|| !RequestScopes.callAs(launch.accountId(), launch.region(), () -> stillRunning(launch));
|| !RequestScopes.callAs(launch.accountId(), launch.region(),
() -> mayGoOn(launch, driverStarted));
}
}
@@ -31,6 +31,8 @@ public class EmrStep {
private boolean runInContainer;
private String failureReason;
private String failureMessage;
// Whether its cancel is pending after SEND_INTERRUPT, its process sent SIGTERM and free to finish on its own.
private boolean interrupted;
private Instant creationDateTime;
private Instant startDateTime;
private Instant endDateTime;
@@ -79,6 +81,9 @@ public class EmrStep {
public String getFailureReason() { return failureReason; }
public void setFailureReason(String failureReason) { this.failureReason = failureReason; }
public boolean isInterrupted() { return interrupted; }
public void setInterrupted(boolean interrupted) { this.interrupted = interrupted; }
public String getFailureMessage() { return failureMessage; }
public void setFailureMessage(String failureMessage) { this.failureMessage = failureMessage; }
@@ -2,6 +2,8 @@ package io.floci.aws.services.emrserverless;
import com.github.dockerjava.api.async.ResultCallback;
import com.github.dockerjava.api.command.InspectContainerResponse;
import com.github.dockerjava.api.exception.ConflictException;
import com.github.dockerjava.api.exception.NotFoundException;
import com.github.dockerjava.api.model.Container;
import com.github.dockerjava.api.model.Frame;
import com.github.dockerjava.api.model.StreamType;
@@ -52,6 +54,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.function.BooleanSupplier;
@@ -482,6 +485,8 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
private final Map<String, SparkExecutors.Capacity> capacities = new ConcurrentHashMap<>();
// Where Floci reaches the Spark UI of each EMR Serverless Spark run's driver, by run, while its container runs.
private final Map<String, ContainerLifecycleManager.EndpointInfo> driverUis = new ConcurrentHashMap<>();
// The runs asked to interrupt their driver, which the thread watching each sends it SIGTERM for.
private final Set<String> interrupts = ConcurrentHashMap.newKeySet();
private final ContainerBuilder containerBuilder;
private final ContainerLifecycleManager lifecycleManager;
@@ -556,6 +561,9 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
ContainerBuilder.Builder container = containerBuilder.newContainer(launchImage(job, progress))
.withName(ContainerStorageHelper.dockerName(config, job.service() + "-" + job.runId()))
.withEnv(environment(awsEnvironment, job.environment()));
if (job.interruptible()) {
container.withInit();
}
// bash -c's script gets "floci" as its $0, and what runs after it as its arguments, "$@".
if (job.engine() == Engine.HIVE) {
List<String> hive = hiveArguments(job, endpoint, executorEnvironment);
@@ -712,6 +720,7 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
return Outcome.couldNotStart(e.getMessage());
} finally {
driverUis.remove(job.runId());
interrupts.remove(job.runId());
// The executors go with their driver, however the run ended, and their workers' share of the
// application's capacity with them.
if (executors != null) {
@@ -722,6 +731,7 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
}
String unclaimed = launches.end(job.runId(), launch);
if (unclaimed != null) {
killInterruptible(job, unclaimed);
lifecycleManager.stopAndRemove(unclaimed, logHandle, STOP_TIMEOUT_SECONDS);
} else if (logHandle != null) {
// Floci's teardown claimed the driver, but the log stream is still this run's to close.
@@ -763,6 +773,50 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
}
}
/**
* Asks the thread watching the run's running driver to send its container SIGTERM, which the container's init
* process passes on to the driver ({@link Job#asInterruptible}), and to let the run end as the driver does. Like
* {@link #stop}, it makes no Docker call, so the caller is never held up by Docker. A run whose driver has not
* started yet is not interrupted here: its caller reports it cancelled until then.
*/
@Override
public void interrupt(String runId) {
if (launches.get(runId) != null) {
interrupts.add(runId);
}
}
// Sends the driver's container SIGTERM; one Docker cannot send it to is stopped instead, so the run still ends.
private void sendSigterm(String containerId, Job job, ContainerLaunches.Launch launch) {
try {
lifecycleManager.getDockerClient().killContainerCmd(containerId).withSignal("SIGTERM").exec();
} catch (NotFoundException | ConflictException e) {
// Gone, or no longer running: the next look finds it ended.
} catch (RuntimeException e) {
LOG.warnv(e, "Could not send SIGTERM to the driver of Spark run {0}; stopping it", job.runId());
launch.requestStop();
}
}
/**
* Sends an interruptible job's driver container SIGKILL, where it still runs, before it is stopped: Docker's stop
* sends SIGTERM first, which the container's init process passes on to the driver, so a driver stopped at once
* would get a SIGTERM to handle ({@link Job#asInterruptible}).
*/
private void killInterruptible(Job job, String containerId) {
if (!job.interruptible()) {
return;
}
try {
lifecycleManager.getDockerClient().killContainerCmd(containerId).exec();
} catch (NotFoundException | ConflictException e) {
// Gone, or no longer running: nothing to kill.
} catch (RuntimeException e) {
// Docker's stop that follows sends SIGKILL at its end anyway.
LOG.warnv(e, "Could not kill the driver of Spark run {0}", job.runId());
}
}
/**
* Stops every run inside {@link #run}, so a reset or a shutdown orphans none: a running driver is
* stopped and removed now, and one whose image is still being pulled as soon as its container is up.
@@ -1808,6 +1862,9 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
SparkExecutors executors) throws InterruptedException {
Instant deadline = job.timeout().isZero() ? null : clock.instant().plus(job.timeout());
while (!launch.stopRequested() && !progress.cancelled()) {
if (interrupts.remove(job.runId())) {
sendSigterm(containerId, job, launch);
}
if (executors != null) {
executors.follow();
}
@@ -1845,6 +1902,7 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
}
// Closed however the read ends, which ends Docker's stream and the compressors.
try (DriverOutput output = new DriverOutput()) {
killInterruptible(job, containerId);
lifecycleManager.stop(containerId, STOP_TIMEOUT_SECONDS);
lifecycleManager.getDockerClient().logContainerCmd(containerId)
.withStdOut(true)
@@ -28,6 +28,16 @@ public interface SparkJobRunner {
*/
void stop(String runId);
/**
* Sends the run's running driver SIGTERM and lets it end as it will, where {@link #stop} ends it at once: a driver
* that handles the signal may clean up first, and one that ignores it runs on. {@link #run} then returns its exit
* code. Without a driver running yet there is nothing to interrupt, so the run is stopped; that is all a runner
* that cannot signal its drivers does.
*/
default void interrupt(String runId) {
stop(runId);
}
/**
* Where Floci reaches the Spark UI of run {@code runId}'s driver while its container runs, for an EMR Serverless
* Spark run or session; empty for any other run, and before or after its container runs.
@@ -143,7 +153,7 @@ public interface SparkJobRunner {
List<String> archives, Storage storage, Map<String, String> coreSite,
Map<String, String> sparkLog4j2, Map<String, String> mapredSite, Map<String, String> hadoopLog4j,
Map<String, String> hadoopEnvironment, Executors executors, String platform, int listenPort,
boolean keepsEventLogs) {
boolean keepsEventLogs, boolean interruptible) {
/** A job whose driver listens on no port for Floci. */
public Job(String service, String runId, String accountId, String region, String releaseLabel, Engine engine,
@@ -157,7 +167,7 @@ public interface SparkJobRunner {
this(service, runId, accountId, region, releaseLabel, engine, imageTemplate, customImage, dockerNetwork,
executionRole, sparkDefaults, application, command, timeout, logFolder, cloudWatchLogs,
environment, archives, storage, coreSite, sparkLog4j2, mapredSite, hadoopLog4j,
hadoopEnvironment, executors, platform, 0, false);
hadoopEnvironment, executors, platform, 0, false, false);
}
/** A job on the Docker host's own platform. */
@@ -179,7 +189,7 @@ public interface SparkJobRunner {
return new Job(service, runId, accountId, region, releaseLabel, engine, imageTemplate, customImage,
dockerNetwork, executionRole, sparkDefaults, application, command, timeout, logFolder,
cloudWatchLogs, environment, archives, storage, coreSite, sparkLog4j2, mapredSite, hadoopLog4j,
hadoopEnvironment, executors, platform, listenPort, keepsEventLogs);
hadoopEnvironment, executors, platform, listenPort, keepsEventLogs, interruptible);
}
/** This job, run in {@code image}. */
@@ -187,7 +197,7 @@ public interface SparkJobRunner {
return new Job(service, runId, accountId, region, releaseLabel, engine, image, customImage, dockerNetwork,
executionRole, sparkDefaults, application, command, timeout, logFolder, cloudWatchLogs, environment,
archives, storage, coreSite, sparkLog4j2, mapredSite, hadoopLog4j, hadoopEnvironment, executors,
platform, listenPort, keepsEventLogs);
platform, listenPort, keepsEventLogs, interruptible);
}
/** This job, its executors where {@code executors} has them. */
@@ -195,7 +205,7 @@ public interface SparkJobRunner {
return new Job(service, runId, accountId, region, releaseLabel, engine, imageTemplate, customImage,
dockerNetwork, executionRole, sparkDefaults, application, command, timeout, logFolder,
cloudWatchLogs, environment, archives, storage, coreSite, sparkLog4j2, mapredSite, hadoopLog4j,
hadoopEnvironment, executors, platform, listenPort, keepsEventLogs);
hadoopEnvironment, executors, platform, listenPort, keepsEventLogs, interruptible);
}
/** This job, its driver listening on {@code port} for Floci (0 for none). */
@@ -203,7 +213,7 @@ public interface SparkJobRunner {
return new Job(service, runId, accountId, region, releaseLabel, engine, imageTemplate, customImage,
dockerNetwork, executionRole, sparkDefaults, application, command, timeout, logFolder,
cloudWatchLogs, environment, archives, storage, coreSite, sparkLog4j2, mapredSite, hadoopLog4j,
hadoopEnvironment, executors, platform, port, keepsEventLogs);
hadoopEnvironment, executors, platform, port, keepsEventLogs, interruptible);
}
/** This job, its containers on {@code network} (null for the global default). */
@@ -211,7 +221,7 @@ public interface SparkJobRunner {
return new Job(service, runId, accountId, region, releaseLabel, engine, imageTemplate, customImage,
network, executionRole, sparkDefaults, application, command, timeout, logFolder, cloudWatchLogs,
environment, archives, storage, coreSite, sparkLog4j2, mapredSite, hadoopLog4j, hadoopEnvironment,
executors, platform, listenPort, keepsEventLogs);
executors, platform, listenPort, keepsEventLogs, interruptible);
}
/** This job, its Spark event logs kept for its Spark History Server once it ends. */
@@ -219,7 +229,19 @@ public interface SparkJobRunner {
return new Job(service, runId, accountId, region, releaseLabel, engine, imageTemplate, customImage,
dockerNetwork, executionRole, sparkDefaults, application, command, timeout, logFolder,
cloudWatchLogs, environment, archives, storage, coreSite, sparkLog4j2, mapredSite, hadoopLog4j,
hadoopEnvironment, executors, platform, listenPort, true);
hadoopEnvironment, executors, platform, listenPort, true, interruptible);
}
/**
* This job, its driver's process sent the signals its container gets by an init process, as Docker's
* {@code --init} runs one, so that {@link SparkJobRunner#interrupt} reaches it: a container's own first process
* ignores SIGTERM unless it handles it.
*/
public Job asInterruptible() {
return new Job(service, runId, accountId, region, releaseLabel, engine, imageTemplate, customImage,
dockerNetwork, executionRole, sparkDefaults, application, command, timeout, logFolder,
cloudWatchLogs, environment, archives, storage, coreSite, sparkLog4j2, mapredSite, hadoopLog4j,
hadoopEnvironment, executors, platform, listenPort, keepsEventLogs, true);
}
/** This job, its containers run for {@code platform} (null for the Docker host's own). */
@@ -227,7 +249,7 @@ public interface SparkJobRunner {
return new Job(service, runId, accountId, region, releaseLabel, engine, imageTemplate, customImage,
dockerNetwork, executionRole, sparkDefaults, application, command, timeout, logFolder,
cloudWatchLogs, environment, archives, storage, coreSite, sparkLog4j2, mapredSite, hadoopLog4j,
hadoopEnvironment, executors, platform, listenPort, keepsEventLogs);
hadoopEnvironment, executors, platform, listenPort, keepsEventLogs, interruptible);
}
}