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.

Author yselivanov
Recipients asvetlov, yselivanov
Date 2018-06-01.05:11:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527829909.37.0.682650639539.issue33727@psf.upfronthosting.co.za>
In-reply-to
Content
Server.wait_closed() currently does two checks:

1. if _sockets is None -- means that Server.close() was called
2. if self._waiters is None -- means that Server._wakeup() was called

if (1) *or* (2) is true, wait_closed() just returns without waiting on anything.

However, when Server.close() is called there might be still active transports serving requests.  Server.wait_closed() should wait until all of them are detached, even if Server._sockets is already reset.

So the below implementation:

    async def wait_closed(self):
        if self._sockets is None or self._waiters is None:
            return
        waiter = self._loop.create_future()
        self._waiters.append(waiter)
        await waiter

should be changed to:

    async def wait_closed(self):
        if self._waiters is None:
            assert self._active_count == 0
            return
        waiter = self._loop.create_future()
        self._waiters.append(waiter)
        await waiter
History
Date User Action Args
2018-06-01 05:11:49yselivanovsetrecipients: + yselivanov, asvetlov
2018-06-01 05:11:49yselivanovsetmessageid: <1527829909.37.0.682650639539.issue33727@psf.upfronthosting.co.za>
2018-06-01 05:11:49yselivanovlinkissue33727 messages
2018-06-01 05:11:49yselivanovcreate