Skip to content

Commit

Permalink
[FLINK-27261] Disable 'web.cancel.enable' for session cluster
Browse files Browse the repository at this point in the history
This closes #198.
  • Loading branch information
SteNicholas authored May 11, 2022
1 parent 6ce3d96 commit 60654f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ protected FlinkConfigBuilder applyFlinkConfiguration() {
// Adapt default rest service type from 1.15+
setDefaultConf(
REST_SERVICE_EXPOSED_TYPE, KubernetesConfigOptions.ServiceExposedType.ClusterIP);
// Set 'web.cancel.enable' to false to avoid users accidentally cancelling jobs.
setDefaultConf(CANCEL_ENABLE, false);

if (spec.getJob() != null) {
// Set 'web.cancel.enable' to false for application deployments to avoid users
// accidentally cancelling jobs.
setDefaultConf(CANCEL_ENABLE, false);

// With last-state upgrade mode, set the default value of
// 'execution.checkpointing.interval'
// to 5 minutes when HA is enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ public void testApplyFlinkConfiguration() {
Assertions.assertEquals(
DEFAULT_CHECKPOINTING_INTERVAL,
configuration.get(ExecutionCheckpointingOptions.CHECKPOINTING_INTERVAL));

deployment = TestUtils.buildSessionCluster();
configuration =
new FlinkConfigBuilder(deployment, new Configuration())
.applyFlinkConfiguration()
.build();
Assertions.assertEquals(false, configuration.get(WebOptions.CANCEL_ENABLE));
}

@Test
Expand Down

0 comments on commit 60654f4

Please sign in to comment.