Menu

1 / 4

What happens when a 40-second LLM call outlives Kafka's 30-second lock

DEV Community: java·Mostafa Tavassoli·5 days ago
#H6EOR0a3
#devtojava#devto#dev#lock#record
Long article (1029 words) — no AI summary yet.
Reading 0:00
15s threshold

Kafka 4.2 made share groups production-ready: queue-style consumption where several consumers take records from the same partitions. Each record is locked to one consumer while it works on it. The default lock is 30 seconds.

Now put an AI agent behind that consumer. One event means a model call, maybe a tool call or two, maybe a retry. Forty seconds is not unusual.

So what happens when the agent is still thinking when the lock expires?

I measured it. Short version: the same event is processed again, up to five times, and every side effect it triggers can happen again. The fixes that work are not the ones I expected, and one framework's built-in fix did not hold.

Why this matters for agents

Classic Kafka consumers are fast: milliseconds per record. A 30-second lock is generous for them.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.