jihoonson commented on a change in pull request #6383: [WIP] Prevent failed
KafkaConsumer creation from blocking overlord startup
URL: https://github.com/apache/incubator-druid/pull/6383#discussion_r221118301
##########
File path:
extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java
##########
@@ -416,61 +421,87 @@ public void start()
ioConfig.getStartDelay(),
spec.toString()
);
+
+ initializationExec.shutdownNow();
}
catch (Exception e) {
if (consumer != null) {
consumer.close();
}
log.makeAlert(e, "Exception starting KafkaSupervisor[%s]", dataSource)
.emit();
- throw Throwables.propagate(e);
}
}
}
+ @Override
+ public void start()
+ {
+ synchronized (stateChangeLock) {
+ Preconditions.checkState(!lifecycleStarted, "already started");
+ Preconditions.checkState(!exec.isShutdown(), "already stopped");
+
+ // Try normal initialization first, if that fails then schedule periodic
initialization retries
+ tryInit();
+ if (!started) {
+ initializationExec.scheduleAtFixedRate(
Review comment:
How about using `RetryUtils.retry()`? It has a backoff mechanism which I
think makes sense to apply here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]