scylladb / seastar

High performance server-side application framework
http://seastar.io
Apache License 2.0
8.39k stars 1.55k forks source link

loopback: add pending capacity param and fix deadlock in httpd_test #2511

Closed tomershafir closed 1 month ago

tomershafir commented 1 month ago

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.