ptgbot/ptgbot
Tony Breeds 287f8d5063 Set SO_REUSEADDR and SO_REUSEPORT to enable faster service restarts
In a fast restart of the service we don't have time for all the TCP
sessions to drain the sockets in TIME_WAIT.  So the service fails to
restart with a "bind address in use".   To avoid this we want to add
SO_REUSEADDR and SO_REUSEPORT.  To do so we have to disable
bind_and_activate so we can then set allow_reuse_address and
allow_reuse_address on the TCPServer before we bind.

For reference:
 * https://docs.python.org/3/library/socketserver.html#socketserver.BaseServer.allow_reuse_address
 * https://github.com/python/cpython/blob/3.11/Lib/socketserver.py#L445
 * https://github.com/python/cpython/blob/3.11/Lib/socketserver.py#L447

Change-Id: I2ecbedf43e9912d430197e4110e4d467a8b449a3
2023-10-04 17:23:05 +11:00
..
html Update Bot to Show Room Descriptions 2022-05-12 06:44:05 -05:00
tests Update ptgbot to python3.11 and Bookworm 2023-09-19 11:13:56 -07:00
__init__.py Initial commit 2017-04-18 14:21:26 +02:00
admincommands.py Add missing clear clean alias 2021-04-22 14:21:01 +02:00
bot.py Adapt PTGBot to OFTC 2021-05-31 15:38:52 +02:00
db.py Add memory-only database mode 2020-11-25 16:03:10 +01:00
ics.py Fix errors in iCal 2023-10-04 10:41:00 +11:00
trackcommands.py Add "clear" as an alias for "clean" 2021-04-21 07:56:46 -07:00
usercommands.py Refactor processing of user commands 2020-12-08 14:35:48 +01:00
web.py Set SO_REUSEADDR and SO_REUSEPORT to enable faster service restarts 2023-10-04 17:23:05 +11:00