AHeise commented on a change in pull request #18043:
URL: https://github.com/apache/flink/pull/18043#discussion_r764995884
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java
##########
@@ -779,6 +779,19 @@ JobManagerRunner createJobManagerRunner(JobGraph jobGraph,
long initializationTi
operatorId, serializedRequest, timeout));
}
+ @Override
+ public void submitFailedJob(JobStartupFailedException exception) {
Review comment:
maybe not `submit` but rather `register`?
##########
File path:
flink-clients/src/main/java/org/apache/flink/client/deployment/application/ApplicationDispatcherBootstrap.java
##########
@@ -159,6 +160,17 @@ public void stop() {
})
.exceptionally(
t -> {
+ final Optional<JobStartupFailedException>
jobStartupFailedOpt =
Review comment:
Is this the right commit for the change? Maybe it should be 3 commits. I
more thought that the scope of this commit is ending with PackageProgram...
##########
File path: flink-clients/src/main/java/org/apache/flink/client/ClientUtils.java
##########
@@ -85,7 +86,7 @@ public static void executeProgram(
PackagedProgram program,
boolean enforceSingleJobExecution,
boolean suppressSysout)
- throws ProgramInvocationException {
+ throws ProgramInvocationException, JobStartupFailedException {
Review comment:
These exception sound like the same to me. Maybe
`JobStartupFailedException extends ProgramInvocationException`?
Now thinking about this, isn't `JobStartupFailedException` implying that the
job's startup didn't work (for example cluster is too small)? Wouldn't a better
name be `Job/ProgramDefinitionException`?
##########
File path:
flink-clients/src/main/java/org/apache/flink/client/program/StreamContextEnvironment.java
##########
@@ -169,12 +236,36 @@ public static void setAsContext(
mergedConfiguration,
userCodeClassLoader,
enforceSingleJobExecution,
- suppressSysout);
+ suppressSysout,
+ allowConfigurations,
+ errors);
};
initializeContextEnvironment(factory);
}
public static void unsetAsContext() {
resetContextEnvironment();
}
+
+ private List<ConfigurationNotAllowedError> checkNotAllowedConfigurations()
{
+ final List<ConfigurationNotAllowedError> errors = new ArrayList<>();
+ if (allowConfigurations) {
+ return errors;
+ }
+ final MapDifference<String, String> diff =
Review comment:
When is `originalConfiguration` not empty?
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/JobStartupFailedException.java
##########
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.dispatcher;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.common.JobID;
+
+import java.util.Collection;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * Exception signalling that an exception occurred during the execution of the
jar's main method.
+ *
+ * <p>The job will transition to FAILED state, and it will not be recovered.
+ */
+@Internal
+public class JobStartupFailedException extends Exception {
+
+ /** Serial version UID for serialization interoperability. */
+ private static final long serialVersionUID = -2417524218857151612L;
+
+ private final Collection<JobValidationError> errors;
Review comment:
Why not just `<String>`?
##########
File path:
flink-clients/src/main/java/org/apache/flink/client/program/StreamContextEnvironment.java
##########
@@ -55,24 +69,67 @@
private final boolean suppressSysout;
private final boolean enforceSingleJobExecution;
+ private final CheckpointConfig originalCheckpointConfig;
+ private final ExecutionConfig originalExecutionConfig;
+ private final Configuration originalConfiguration;
private int jobCounter;
+ private final Collection<JobValidationError> errors;
Review comment:
Afaik this field is unneeded.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]