mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fix(emr-serverless): hold an emr-spark release's BATCH timeout to 7 days (#8390)
From release 7.11.0 a BATCH run's executionTimeoutMinutes is 1 to 10080, "from this release onwards" as its release notes say, but Floci only read emr-x.y labels, so an application on the AWS runtime for Apache Spark (emr-spark-8.0.0 and on, emr-spark-8.0-preview) took 0 and anything up to 1,000,000. The release list puts those releases after EMR Serverless 7.14.0, so their BATCH runs are now held to the same 1 to 10080 minutes; a STREAMING run keeps 0 as no timeout.
This commit is contained in:
1 parent
ddb6680704
commit
d65e76b7ea
3 files changed
+34
-7
No files matched your search
@@ -97,7 +97,9 @@ runner mode a Spark run executes; see [Running Spark job runs](#running-spark-jo
|
||||
(HTTP 409) "Request did not match the original".
|
||||
* **Execution timeout**: `executionTimeoutMinutes` is 0 to 1,000,000, 0 meaning no timeout. From
|
||||
release `emr-7.11.0`, a `BATCH` run's timeout must be 1 to 10080 minutes (7 days), as the model and
|
||||
the 7.11.0 release notes say; a run outside that is refused with `ValidationException`.
|
||||
the 7.11.0 release notes say; a run outside that is refused with `ValidationException`. The AWS runtime for
|
||||
Apache Spark's releases, `emr-spark-8.0.0` on, hold their `BATCH` runs to it too: the notes apply it "from this
|
||||
release onwards", and the release list puts them after EMR Serverless 7.14.0.
|
||||
* **CancelJobRun** moves a run that has not finished to `CANCELLED`. A finished run answers
|
||||
`ValidationException` "Job run is not in a cancellable state".
|
||||
* **StopApplication** refuses an application with a run that has not finished, a `STREAMING` run or
|
||||
|
||||
@@ -1085,8 +1085,7 @@ public class EmrServerlessJobRunService implements Resettable {
|
||||
|
||||
// "EMR Serverless releases 7.1.0 and higher support retry attempts for streaming jobs and batch jobs."
|
||||
private static boolean retriesAttempts(String releaseLabel) {
|
||||
return releaseAtLeast(RELEASE_LABEL, releaseLabel, 7, 1)
|
||||
|| SPARK_RUNTIME_RELEASE_LABEL.matcher(releaseLabel != null ? releaseLabel : "").matches();
|
||||
return releaseAtLeast(RELEASE_LABEL, releaseLabel, 7, 1) || sparkRuntime(releaseLabel);
|
||||
}
|
||||
|
||||
private static void addProperties(Map<String, String> properties, Map<?, ?> configuration, String classification) {
|
||||
@@ -1277,9 +1276,10 @@ public class EmrServerlessJobRunService implements Resettable {
|
||||
}
|
||||
|
||||
/**
|
||||
* From Amazon EMR release 7.11.0 a BATCH run's timeout is 1 to 10080 minutes; an earlier release, or
|
||||
* a STREAMING run, keeps the model's 0 to 1,000,000, 0 meaning none. No source gives AWS's error, so
|
||||
* the wording is Floci's.
|
||||
* From Amazon EMR release 7.11.0 a BATCH run's timeout is 1 to 10080 minutes, on the AWS runtime for Apache
|
||||
* Spark's releases too, as the 7.11.0 release notes' "from this release onwards" reads and the release list puts
|
||||
* them after EMR Serverless 7.14.0; an earlier release, or a STREAMING run, keeps the model's 0 to 1,000,000, 0
|
||||
* meaning none. No source gives AWS's error, so the wording is Floci's.
|
||||
*/
|
||||
private static void checkBatchTimeout(Application app, StartJobRunRequest request) {
|
||||
Long minutes = request.getExecutionTimeoutMinutes();
|
||||
@@ -1295,7 +1295,13 @@ public class EmrServerlessJobRunService implements Resettable {
|
||||
}
|
||||
|
||||
private static boolean boundsBatchTimeouts(String releaseLabel) {
|
||||
return releaseAtLeast(RELEASE_LABEL, releaseLabel, 7, 11);
|
||||
return releaseAtLeast(RELEASE_LABEL, releaseLabel, 7, 11) || sparkRuntime(releaseLabel);
|
||||
}
|
||||
|
||||
// A release of the AWS runtime for Apache Spark, which starts at emr-spark-8.0-preview and comes after EMR
|
||||
// Serverless 7.14.0 in the release list.
|
||||
private static boolean sparkRuntime(String releaseLabel) {
|
||||
return releaseAtLeast(SPARK_RUNTIME_RELEASE_LABEL, releaseLabel, 8, 0);
|
||||
}
|
||||
|
||||
// Whether releaseLabel is of the family labelPattern matches, at major.minor or later.
|
||||
|
||||
+19
@@ -599,6 +599,25 @@ class EmrServerlessJobRunIntegrationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void theAwsRuntimeForApacheSparksBatchRunsTimeoutIsOneToTenThousandEightyMinutesToo() {
|
||||
for (String release : List.of("emr-spark-8.0.0", "emr-spark-8.0-preview")) {
|
||||
String runtime = createApplicationOn(release, "");
|
||||
for (String timeout : List.of(", \"executionTimeoutMinutes\": 0", ", \"executionTimeoutMinutes\": 10081")) {
|
||||
startJobRun(runtime, sparkRun(UUID.randomUUID().toString(), timeout))
|
||||
.then().statusCode(400)
|
||||
.body("__type", equalTo("ValidationException"))
|
||||
.body("message", equalTo("executionTimeoutMinutes must be between 1 and 10080 for a BATCH "
|
||||
+ "job run on release emr-7.11.0 or later."));
|
||||
}
|
||||
startJobRun(runtime, sparkRun(UUID.randomUUID().toString(), ", \"executionTimeoutMinutes\": 10080"))
|
||||
.then().statusCode(200);
|
||||
startJobRun(runtime, sparkRun(UUID.randomUUID().toString(),
|
||||
", \"mode\": \"STREAMING\", \"executionTimeoutMinutes\": 0"))
|
||||
.then().statusCode(200);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void aRunIsItsOneAttempt() {
|
||||
String applicationId = createApplication("");
|
||||
|
||||
Reference in new issue
Block a user