ScenarioProduction Scenarios
How would you debug a 'Network Exception: Disconnected' error in a Kafka producer?
Reference answer
This error usually means the TCP connection to the broker was dropped. Causes: 1) Broker GC pause > connection.max.idle.ms causing broker to close idle connections. 2) Load balancer or firewall idle connection timeout shorter than connection.max.idle.ms. 3) Network instability. 4) Broker overload causing slow responses → client-side timeout. Debug: 1) Check broker logs for connection drops. 2) Check producer reconnect.backoff.ms and reconnect.backoff.max.ms. 3) Verify connection.max.idle.ms (9 min default) vs firewall/LB idle timeout. 4) Check broker RequestHandlerIdlePercent. Fix: reduce connection.max.idle.ms below LB timeout, or configure LB with TCP keepalive.
Expected key concepts: Disconnected, GC pause, connection.max.idle.ms, firewall, load balancer, idle timeout, broker overload, reconnect.backoff.ms, TCP keepalive, broker logs, RequestHandlerIdlePercent