Title: Closing asyncio.Server on asyncio.ProactorEventLoop causes all active servers to stop listening
Type: behavior Stage:
Components: asyncio Versions: Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: apatrushev, asvetlov, mliska, yselivanov
Priority: normal Keywords:

Created on 2018-06-11 15:59 by mliska, last changed 2018-07-26 12:31 by apatrushev.

Messages (3)
msg319311 - (view) Author: Martin Liska (mliska) Date: 2018-06-11 15:59
When calling asyncio.Server.close, the method calls asyncio.AbstractEventLoop._stop_serving for each of its sockets in turn.

The implementation of this method in asyncio.ProactorEventLoop calls the _stop_accept_futures method which seems to cancel "accept" futures of all sockets running on the loop, not just the one that was supposed to be stopped. This means that closing one server closes sockets of all existing servers.

With asyncio.SelectorEventLoop there is no such issue.
msg319312 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-06-11 16:01
Andrew, do you have time to take a look into this?
msg322418 - (view) Author: Anton Patrushev (apatrushev) Date: 2018-07-26 12:31
This issue was fixed in:
Date User Action Args
2018-07-26 12:31:43apatrushevsetnosy: + apatrushev
messages: + msg322418
2018-06-11 16:01:34yselivanovsetmessages: + msg319312
2018-06-11 15:59:40mliskacreate