dannycranmer opened a new pull request, #21918:
URL: https://github.com/apache/flink/pull/21918
…sults in memory leak and busy loop
## What is the purpose of the change
Fixes a race condition in DefaultScheduler that results in memory leak and
busy loop.
## Brief change log
- Add a debounce mechanism within `DefaultScheduler` to prevent triggering
multiple global failovers concurrently.
## Verifying this change
- Added unit test
- Verified on Mini Cluster via the following job:
```
StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(1);
env.setRestartStrategy(new
RestartStrategies.FailureRateRestartStrategyConfiguration(10000, Time.of(10,
TimeUnit.SECONDS), Time.of(10, TimeUnit.SECONDS)));
KafkaSource<String> source = KafkaSource.<String>builder()
.setProperty("security.protocol", "SASL_SSL")
// SSL configurations
// Configure the path of truststore (CA) provided by the
server
.setProperty("ssl.truststore.location",
"/path/to/kafka.client.truststore.jks")
.setProperty("ssl.truststore.password", "test1234")
// Configure the path of keystore (private key) if client
authentication is required
.setProperty("ssl.keystore.location",
"/path/to/kafka.client.keystore.jks")
.setProperty("ssl.keystore.password", "test1234")
// SASL configurations
// Set SASL mechanism as SCRAM-SHA-256
.setProperty("sasl.mechanism", "SCRAM-SHA-256")
// Set JAAS configurations
.setProperty("sasl.jaas.config",
"org.apache.kafka.common.security.scram.ScramLoginModule required
username=\"username\" password=\"password\";")
.setBootstrapServers("http://localhost:3456")
.setTopics("input-topic")
.setGroupId("my-group")
.setStartingOffsets(OffsetsInitializer.earliest())
.setValueOnlyDeserializer(new SimpleStringSchema())
.build();
List<SingleOutputStreamOperator<String>> sources =
IntStream.range(0, 32)
.mapToObj(i -> env
.fromSource(source,
WatermarkStrategy.noWatermarks(), "Kafka Source " + i).uid("source-" + i)
.keyBy(s -> s.charAt(0))
.map(s -> s))
.collect(Collectors.toList());
env.fromSource(source, WatermarkStrategy.noWatermarks(), "Kafka
Source").uid("source")
.keyBy(s -> s.charAt(0))
.union(sources.toArray(new SingleOutputStreamOperator[] {}))
.print();
env.execute("test job");
```
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
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]