Set TCP listen backlog for API socket to SOMAXCONN

A value of 1 is too low for heavy users of the API, such as the weldr-web
interface.

This is also systemd's default for sockets it opens. Using lorax-composer with
socket activation already results in a backlog of SOMAXCONN connections.

(cherry picked from commit be5d50e6f3)
This commit is contained in:
Lars Karlitski 2018-08-18 13:44:32 +02:00 committed by Brian C. Lane
parent cef073d832
commit d55ff41870

View File

@ -230,7 +230,7 @@ if __name__ == '__main__':
listener.bind(opts.socket) listener.bind(opts.socket)
os.chmod(opts.socket, 0o660) os.chmod(opts.socket, 0o660)
os.chown(opts.socket, 0, gid) os.chown(opts.socket, 0, gid)
listener.listen(1) listener.listen(socket.SOMAXCONN)
start_queue_monitor(server.config["COMPOSER_CFG"], uid, gid) start_queue_monitor(server.config["COMPOSER_CFG"], uid, gid)