Hi folks,
I was curious about trio networking api so I dig in the code, and I saw this
async def _serve_one_listener(listener, handler_nursery, handler):
async with listener:
while True:
try:
stream = await listener.accept()
except OSError as exc:
if exc.errno in ACCEPT_CAPACITY_ERRNOS:
LOGGER.error(
"accept returned %s (%s); retrying in %s seconds",
errno.errorcode[exc.errno],
os.strerror(exc.errno),
SLEEP_TIME,
exc_info=True
)
await trio.sleep(SLEEP_TIME)
else:
raise
else:
handler_nursery.start_soon(_run_handler, stream, handler)
It seems that trio doesn’t attempt to limit the number of concurrent connections as it is the case with other libraries (like gevent) that propose ways to limit concurrency.
I’d like to know what makes you confident that this strategy won’t break the system or the trio event loop.
Best regards