This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Closing asyncio.Server on asyncio.ProactorEventLoop causes all active servers to stop listening
Type: behavior Stage: resolved
Components: asyncio Versions: Python 3.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: When you use stop_serving in proactor loop it's kill all listening servers
View: 29711
Assigned To: Nosy List: apatrushev, asvetlov, mliska, vstinner, yselivanov
Priority: normal Keywords:

Created on 2018-06-11 15:59 by mliska, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
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:
git319c0345cdd8fddb49d235462e71883f1dd51b99
msg333691 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-01-15 12:15
Duplicate of bpo-29711 and already fixed.
History
Date User Action Args
2022-04-11 14:59:01adminsetgithub: 78018
2019-01-15 12:15:04vstinnersetstatus: open -> closed

superseder: When you use stop_serving in proactor loop it's kill all listening servers

nosy: + vstinner
messages: + msg333691
resolution: duplicate
stage: resolved
2018-07-26 12:31:43apatrushevsetnosy: + apatrushev
messages: + msg322418
2018-06-11 16:01:34yselivanovsetmessages: + msg319312
2018-06-11 15:59:40mliskacreate