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

Created on 2018-06-11 15:59 by mliska, last changed 2018-06-11 16:01 by yselivanov.

Messages (2)
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?
History
Date User Action Args
2018-06-11 16:01:34yselivanovsetmessages: + msg319312
2018-06-11 15:59:40mliskacreate