> why if a request is timeout, the tcp connection will be closed? As described in the wiki, the typical cause of request timeout is due to the leader failover, which requires the client to discover the new leader and reconnect.
> not close the connection until connection.max.idle.ms The connection is actually closed on request timeout. Rather, the purpose of connection.max.idle.ms is to close connections which are no longer necessary. The typical case is to close bootstrap server connections after discovering the interested leader from bootstrap servers. Without this, any client may keep connections with bootstrap servers which might cause the broker's open fds to be exhausted. 2025年2月27日(木) 6:46 Hongshun Wang <loserwang1...@gmail.com>: > Each reconnection will need to authenticate. It cost a lot. > > On Tue, Feb 25, 2025 at 5:28 PM Hongshun Wang <loserwang1...@gmail.com> > wrote: > > > Hi, devs, > > > > I am curious about why if a request is timeout, the tcp connection will > be > > closed?[1] ? When close a tcp connection, all the pending request will > be > > return TimeoutException. Isn’t a waste? > > > > I notice that connection.max.idle.ms[2] will close idle connections > after > > the number of milliseconds specified. Why we just return TimeoutException > > for the target request, and not close the connection until > > connection.max.idle.ms? > > > > I do want to know the design idea. Much appreciate if anyone can answer > me? > > > > > > Best, > > Hongshun > > > > > > > > > > [1] > > > https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=55154824#KIP19AddarequesttimeouttoNetworkClient-Actionsafterrequesttimeout > > [2] > > > https://docs.confluent.io/platform/current/installation/configuration/producer-configs.html#connections-max-idle-ms > > > -- ======================== Okada Haruki ocadar...@gmail.com ========================