Title: gh-79033: Try to fix asyncio.Server.wait_closed() again by gvanrossum · Pull Request #111336 · python/cpython · GitHub
Open Graph Title: gh-79033: Try to fix asyncio.Server.wait_closed() again by gvanrossum · Pull Request #111336 · python/cpython
X Title: gh-79033: Try to fix asyncio.Server.wait_closed() again by gvanrossum · Pull Request #111336 · python/cpython
Description: I identified the condition that wait_closed() is intended to wait for: the server is closed and there are no more active connections. When this condition first becomes true, _wakeup() is called (either from close() or from _detach()) and it sets _waiters to None. So we just check for self._waiters is None; if it's not None, we know we have to wait, and do so. A problem was that the new test introduced in 3.12 explicitly tested that wait_closed() returns immediately when the server is not closed but there are currently no active connections. This was a mistake (probably a misunderstanding of the intended semantics). I've fixed the test, and added a separate test that checks exactly for this scenario. I also fixed an oddity where in _wakeup() the result of the waiter was set to the waiter itself. This result is not used anywhere and I changed this to None, to avoid a GC cycle. Issue: gh-79033 📚 Documentation preview 📚: https://cpython-previews--111336.org.readthedocs.build/
Open Graph Description: I identified the condition that wait_closed() is intended to wait for: the server is closed and there are no more active connections. When this condition first becomes true, _wakeup() is called (ei...
X Description: I identified the condition that wait_closed() is intended to wait for: the server is closed and there are no more active connections. When this condition first becomes true, _wakeup() is called (ei...
Opengraph URL: https://github.com/python/cpython/pull/111336
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e1137139-cf8c-cbd8-08a9-96c407d6c725 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DAE4:393FCF:8C5BC:B1276:6969B88B |
| html-safe-nonce | 6889abd955a2cd1a82756853a01602b0a513cafe1f0a747ab28a74b3117d0c64 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUU0OjM5M0ZDRjo4QzVCQzpCMTI3Njo2OTY5Qjg4QiIsInZpc2l0b3JfaWQiOiI2NzkxMjI2MDQxMzcyODgzMDgzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 43f742e817b9c0b821d51c55bd8a10aedfb2fe1c2e2916235b857b706fd4e7e9 |
| hovercard-subject-tag | pull_request:1573521570 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/111336/files |
| twitter:image | https://avatars.githubusercontent.com/u/2894642?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2894642?s=400&v=4 |
| og:image:alt | I identified the condition that wait_closed() is intended to wait for: the server is closed and there are no more active connections. When this condition first becomes true, _wakeup() is called (ei... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width