mirror of https://github.com/apache/druid.git
Fix Kafka Indexing Service notice handle thread may never terminate (#6337)
* Fix Kafka Indexing Service notice handle thread may never terminate * address comment * handle null value
This commit is contained in:
parent
faf3f1e426
commit
993bc5e9d3
|
@ -367,8 +367,12 @@ public class KafkaSupervisor implements Supervisor
|
|||
exec.submit(
|
||||
() -> {
|
||||
try {
|
||||
while (!Thread.currentThread().isInterrupted()) {
|
||||
final Notice notice = notices.take();
|
||||
long pollTimeout = Math.max(ioConfig.getPeriod().getMillis(), MAX_RUN_FREQUENCY_MILLIS);
|
||||
while (!Thread.currentThread().isInterrupted() && !stopped) {
|
||||
final Notice notice = notices.poll(pollTimeout, TimeUnit.MILLISECONDS);
|
||||
if (notice == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
notice.handle();
|
||||
|
|
Loading…
Reference in New Issue