I was hit by massive deadlocks in unbound listening for tcp connections. Sometimes it arrives to state when number of idle tcp connections is maxed at incoming-num-tcp. New connections are not accepted, listening socket is excluded in select().
But idle unused connections never die. So, listening stops forever.
Not sure, but it looks like I found the reason. When incoming-num-tcp is about to be full the last added sockets are added
with c->tcp_timeout_msec==0. The first time in setup_tcp_handler timeout is forced to be TCP_QUERY_TIMEOUT_MINIMUM.
But if the socket did some io, the further comm_point_start_listening() are done with real 0(!) and timer is not started anymore. After several expirations of old sockets with non-zero timeout all the sockets remain with c->tcp_timeout_msec==0 and unbound stucks forever.
It is just a theory. I added capping c->tcp_timeout_msec to TCP_QUERY_TIMEOUT_MINIMUM in setup_tcp_handler().
Waiting for results. But I think more experienced developer could figure out the problem w/o waiting.
I was hit by massive deadlocks in unbound listening for tcp connections. Sometimes it arrives to state when number of idle tcp connections is maxed at incoming-num-tcp. New connections are not accepted, listening socket is excluded in select().
But idle unused connections never die. So, listening stops forever.
Not sure, but it looks like I found the reason. When incoming-num-tcp is about to be full the last added sockets are added
with c->tcp_timeout_msec==0. The first time in setup_tcp_handler timeout is forced to be TCP_QUERY_TIMEOUT_MINIMUM.
But if the socket did some io, the further comm_point_start_listening() are done with real 0(!) and timer is not started anymore. After several expirations of old sockets with non-zero timeout all the sockets remain with c->tcp_timeout_msec==0 and unbound stucks forever.
It is just a theory. I added capping c->tcp_timeout_msec to TCP_QUERY_TIMEOUT_MINIMUM in setup_tcp_handler().
Waiting for results. But I think more experienced developer could figure out the problem w/o waiting.