asyncCommitInFlight concurrency
Closed this issue · 2 comments
mauhiz commented
Non-volatile field CommitManager.asyncCommitInFlight
is updated from
CommitManager.commitAsync
(decaton subscription thread)consumer.commitAsync
callback (kafka background I/O thread)
To ensure it is always correctly updated, it should be atomic or at least volatile.
ocadaruma commented
Against the name commitAsync
, the callback is ensured to be triggered on consumer-loop's thread (i.e. subscription thread) at least as of current kafka-clients version.
Also we are checking it just in case:
https://github.com/line/decaton/blob/master/processor/src/main/java/com/linecorp/decaton/processor/runtime/internal/CommitManager.java#L134-L139
mauhiz commented
I misunderstood the Kafka docs. There is no problem.