Skip to content

Commit 30294de

Browse files
committed
docs: document why callbackDispatcher daemon threads are safe for offset bookkeeping
1 parent 0a624ea commit 30294de

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/io/confluent/connect/elasticsearch/ElasticsearchClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public ElasticsearchClient(
145145

146146
AtomicInteger dispatcherCounter = new AtomicInteger(0);
147147
String dispatcherPrefix = connectorName + "-" + taskId + "-es-bulk-callback-";
148+
// Daemon: BulkIngester.close() blocks until all afterBulk callbacks complete, so the
149+
// JVM never exits with offset bookkeeping mid-flight on these threads.
148150
this.callbackDispatcher = Executors.newCachedThreadPool(r -> {
149151
Thread t = new Thread(r, dispatcherPrefix + dispatcherCounter.getAndIncrement());
150152
t.setDaemon(true);

0 commit comments

Comments
 (0)