-
Notifications
You must be signed in to change notification settings - Fork 264
Description
As a continuation of issue #4666, the producer created in KafkaConnectionManager::getConnection() is not currently setting the connections.max.idle.ms.
See more details at #4666 (comment)
Kafka producers have the configuration parameter
connections.max.idle.msto close inactive sockets (without destroying the producer). This releases network resources without destroying the producer. If the producer needs to send a message after the socket is closed, it automatically opens a new connection. Kafka does not “reconnect” the same closed TCP connection; it creates a new one (to the same broker). However, the producer object (rd_kafka_t) remains the same, keeping its configuration and internal state. It does not free the producer’s memory.What should we do in Orion? Avoid destroying producers, or be very conservative about doing so—destroy them only when strictly necessary.
When would we need to destroy the producer in Orion?
If we need to apply credential changes, which is not implemented at the moment.
Inactive clusters (long periods) — cleanup should be conservative (30+ days).
This leads to the following issue:
- Apply the
connections.max.idle.msconfiguration to the Kafka producer (improvement)
As a side setting, the retry policy should be also set.