Refuse to start jobs with incompatible version pairs
@@ -496,6 +496,12 @@ public class JobController {
/** Orders a run of the given type, or throws an IllegalStateException if that job type is already running. */
public void start(ApplicationId id, JobType type, Versions versions, boolean isRedeployment, JobProfile profile, Optional<String> reason) {
+ if (versions.targetApplication().compileVersion()
+ .map(version -> controller.applications().versionCompatibility().refuse(versions.targetPlatform(), version))
+ .orElse(false))
+ throw new IllegalArgumentException("Will not start a job with incompatible platform version (" + versions.targetPlatform() + ") " +
+ "and compile versions (" + versions.targetApplication().compileVersion().get() + ")");
+
locked(id, type, __ -> {
Optional<Run> last = last(id, type);
if (last.flatMap(run -> active(run.id())).isPresent())
