The class loopback_connection_factory used a magic number valued 10 as the capacity of the connection queue per shard. As a result, test units can badly program the device. For example, httpd_test would deadlock on a machine with 10 vCPUs or more, because connect() waits for queue space to be released, and queue space is only released after the connect() call. This commit adds a pending_capacity param to provide the needed control for test units, via factory method to disambiguate constructors. Also, it fixes the deadlock in httpd_test.cc using the new interface.
The class
loopback_connection_factory
used a magic number valued10
as the capacity of the connection queue per shard. As a result, test units can badly program the device. For example,httpd_test
would deadlock on a machine with 10 vCPUs or more, becauseconnect()
waits for queue space to be released, and queue space is only released after theconnect()
call. This commit adds apending_capacity
param to provide the needed control for test units, via factory method to disambiguate constructors. Also, it fixes the deadlock inhttpd_test.cc
using the new interface.