What happens when a 40-second LLM call outlives Kafka's 30-second lock?
A blocked consumer thread let one record reach its five-delivery limit even though deduplication prevented repeated side effects.
Kafka delivered one record five times, even though deduplication reduced its simulated side effects to one.
Question
Does deduplicating side effects also prevent repeated work when a Kafka share-group record lock expires?
What I did
I tested the slow handler with a plain Kafka client and with SmallRye share groups.
What I saw
With a plain Kafka client, the consumer thread blocked past the record lock. One record was delivered five times, reaching the delivery limit. Deduplication reduced five simulated side effects to one, but the handler still did the work five times. A longer lock or renewal from a free consumer thread gave one delivery. In the SmallRye configurations I tested, renewal did not keep the lock, and a later record never reached the handler.
What to do
- Make side effects idempotent: running the handler again should not repeat the effect.
- Size the lock for worst-case processing time.
- Test lock renewal with the consumer configuration you actually use.
- Alert on a delivery count above one; a deduplicated write won't tell you that the work ran again.
Limits
Tested with a plain Kafka client and SmallRye share groups using a slow scripted handler.
Evidence
The results document the delivery tests. A SmallRye maintainer confirmed issue #3636 as a bug; a fix has not yet been released.