Skip to content

Commit

Permalink
Clean useless InterruptedException warn in ingestion task log (#15519)
Browse files Browse the repository at this point in the history
* Clean useless InterruptedException warn in ingestion task log

* test coverage for the code change, manually close the scheduler thread to trigger Interrupt signal

---------

Co-authored-by: Qiong Chen <[email protected]>
  • Loading branch information
fectrain and Qiong Chen authored Dec 15, 2023
1 parent 9deeb28 commit c9be1cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ private void sendToKafka(final String topic, MemoryBoundLinkedBlockingQueue<Stri
}
}
catch (Throwable e) {
if (e instanceof InterruptedException && e.getMessage() == null) {
log.info("Normal exit.");
return;
}
log.warn(e, "Exception while getting record from queue or producer send, Events would not be emitted anymore.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ protected Producer<String, String> setKafkaProducer()
}
countDownSentEvents.await();

kafkaEmitter.close();

Assert.assertEquals(0, kafkaEmitter.getMetricLostCount());
Assert.assertEquals(0, kafkaEmitter.getAlertLostCount());
Assert.assertEquals(0, kafkaEmitter.getSegmentMetadataLostCount());
Expand Down

0 comments on commit c9be1cb

Please sign in to comment.