Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Makes tests wait only 500ms for consumer group cleanup #8367

Merged
merged 2 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,12 @@ public class KsqlConfig extends AbstractConfig {
public static final String KSQL_VARIABLE_SUBSTITUTION_ENABLE_DOC
= "Enable variable substitution on SQL statements.";

public static final String KSQL_QUERY_CLEANUP_SHUTDOWN_TIMEOUT_MS
= "ksql.query.cleanup.shutdown.timeout.ms";
public static final long KSQL_QUERY_CLEANUP_SHUTDOWN_TIMEOUT_MS_DEFAULT = 30000;
public static final String KSQL_QUERY_CLEANUP_SHUTDOWN_TIMEOUT_MS_DOC
= "The total time that the query cleanup spends trying to clean things up on shutdown.";

private enum ConfigGeneration {
LEGACY,
CURRENT
Expand Down Expand Up @@ -1165,6 +1171,13 @@ private static ConfigDef buildConfigDef(final ConfigGeneration generation) {
Importance.LOW,
KSQL_SOURCE_TABLE_MATERIALIZATION_ENABLED_DOC
)
.define(
KSQL_QUERY_CLEANUP_SHUTDOWN_TIMEOUT_MS,
Type.LONG,
KSQL_QUERY_CLEANUP_SHUTDOWN_TIMEOUT_MS_DEFAULT,
Importance.LOW,
KSQL_QUERY_CLEANUP_SHUTDOWN_TIMEOUT_MS_DOC
)
.withClientSslSupport();

for (final CompatibilityBreakingConfigDef compatibilityBreakingConfigDef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,9 @@ public void close(final boolean closeQueries) {
primaryContext.getQueryRegistry().close(closeQueries);

try {
cleanupService.stopAsync().awaitTerminated(30, TimeUnit.SECONDS);
cleanupService.stopAsync().awaitTerminated(
ksqlConfig.getLong(KsqlConfig.KSQL_QUERY_CLEANUP_SHUTDOWN_TIMEOUT_MS),
TimeUnit.MILLISECONDS);
} catch (final TimeoutException e) {
log.warn("Timed out while closing cleanup service. "
+ "External resources for the following applications may be orphaned: {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ private static KsqlRestConfig buildConfig(
configMap.put(KsqlConfig.KSQL_STREAMS_PREFIX + "auto.offset.reset", "earliest");
configMap.put(KsqlConfig.KSQL_ENABLE_UDFS, false);
configMap.put(KsqlRestConfig.KSQL_HEARTBEAT_ENABLE_CONFIG, false);
configMap.put(KsqlConfig.KSQL_QUERY_CLEANUP_SHUTDOWN_TIMEOUT_MS, 500L);
configMap.putAll(additionalProps);
return configMap;
}
Expand Down