aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/asyncio/base_events.py
Commit message (Collapse)AuthorAge
* gh-128307: Support eager_start=<bool> in create_eager_task_factory and ↵Thomas Grainger2025-05-05
| | | | | | | various create_task functions (#128306) Some create_task() functions were changed from `name=None, context=None` to `**kwargs`. Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* gh-86513: improve docs of loop.call_exception_handler (#132466)Kumar Aditya2025-04-13
|
* gh-132307: Remove unnecessary check in `asyncio/base_events.py` (#132324)Stan Ulbrych2025-04-10
|
* gh-131325: fix sendfile fallback implementation to drain data after writing ↵Kumar Aditya2025-03-18
| | | | to transport (#131376)
* gh-130145: fix `loop.run_forever` when loop is already running (#130146)Kumar Aditya2025-02-15
|
* gh-128308: pass `**kwargs` to asyncio task_factory (#128768)Thomas Grainger2025-01-20
| | | Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets (GH-128933)Michał Górny2025-01-17
| | | | | | | | | | | | | | | * gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address families, and the call with fail with Linux kernel 6.12.9 and newer. * Apply suggestions from code review Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk> --------- Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
* gh-128552: fix refcycles in eager task creation (#128553)Thomas Grainger2025-01-07
|
* gh-128340: add thread safe handle for `loop.call_soon_threadsafe` (#128369)Kumar Aditya2025-01-06
| | | Adds `_ThreadSafeHandle` to be used for callbacks scheduled with `loop.call_soon_threadsafe`.
* gh-124858: fix happy eyeballs refcyles (#124859)Thomas Grainger2024-10-02
|
* gh-124309: Revert eager task factory fix to prevent breaking downstream ↵Peter Bierma2024-09-30
| | | | | | | | | | | (#124810) * Revert "GH-124639: add back loop param to staggered_race (#124700)" This reverts commit e0a41a5dd12cb6e9277b05abebac5c70be684dd7. * Revert "gh-124309: Modernize the `staggered_race` implementation to support eager task factories (#124390)" This reverts commit de929f353c413459834a2a37b2d9b0240673d874.
* gh-124309: Modernize the `staggered_race` implementation to support eager ↵Peter Bierma2024-09-26
| | | | | | | | task factories (#124390) Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)Wulian2024-08-11
| | | | | Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`. Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-121913: Use str(exc) instead of exc.strerror in `asyncio.base_events` ↵AN Long2024-07-25
| | | | (#122269)
* gh-113538: Add asycio.Server.{close,abort}_clients (redo) (#116784)Pierre Ossman (ThinLinc team)2024-03-18
| | | | | | | These give applications the option of more forcefully terminating client connections for asyncio servers. Useful when terminating a service and there is limited time to wait for clients to finish up their work. This is a do-over with a test fix for gh-114432, which was reverted.
* gh-113538: Revert "gh-113538: Add asycio.Server.{close,abort}_clients ↵Guido van Rossum2024-03-12
| | | | | | | | | | (#114432)" (#116632) Revert "gh-113538: Add asycio.Server.{close,abort}_clients (#114432)" Reason: The new test doesn't always pass: https://github.com/python/cpython/pull/116423#issuecomment-1989425489 This reverts commit 1d0d49a7e86257ff95b4de0685e6997d7533993c.
* gh-113538: Add asycio.Server.{close,abort}_clients (#114432)Pierre Ossman (ThinLinc team)2024-03-11
| | | | | | These give applications the option of more forcefully terminating client connections for asyncio servers. Useful when terminating a service and there is limited time to wait for clients to finish up their work.
* gh-111358: Fix timeout behaviour in BaseEventLoop.shutdown_default_executor ↵Jamie Phan2024-02-19
| | | | (#115622)
* gh-114887 Reject only sockets of type SOCK_STREAM in ↵Travis Howse2024-02-03
| | | | | | | create_datagram_endpoint() (#114893) Also improve exception message. Co-authored-by: Donghee Na <donghee.na92@gmail.com>
* gh-75128: Ignore EADDRNOTAVAIL error in ↵Serhiy Storchaka2024-01-22
| | | | | asyncio.BaseEventLoop.create_server() (GH-114420) Co-authored-by: Antoine Pitrou <pitrou@free.fr>
* gh-101336: Add keep_alive keyword arg for asyncio create_server() (#112485)beavailable2023-12-13
|
* gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-111336)Guido van Rossum2023-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Try to fix asyncio.Server.wait_closed() again 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. * Update Lib/asyncio/base_events.py --------- Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-110771: Decompose run_forever() into parts (#110773)Russell Keith-Magee2023-10-13
| | | Effectively introduce an unstable, private (really: protected) API for subclasses that want to override `run_forever()`.
* gh-110733: Micro-optimization in BaseEventLoop._run_once (#110735)J. Nick Koston2023-10-11
|
* gh-106634: Corrected minor asyncio doc issues (#106671)Chris Brett2023-07-13
|
* GH-105684: Require `asyncio.Task` implementations to support `set_name` ↵Kumar Aditya2023-06-13
| | | | method (#105685)
* gh-101143: Remove references to `TimerHandle` from ↵J. Nick Koston2023-01-21
| | | | | `asyncio.base_events.BaseEventLoop._add_callback` (#101197) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-86508: skip binding to local addresses of different family in ↵Kumar Aditya2023-01-04
| | | | `asyncio.open_connection` (#100615)
* GH-79033: Fix asyncio.Server.wait_closed() (#98582)Guido van Rossum2022-11-24
| | | | | | | | | | | It was a no-op when used as recommended (after close()). I had to debug one test (test__sock_sendfile_native_failure) -- the cleanup sequence for the test fixture was botched. Hopefully that's not a portend of problems in user code -- this has never worked so people may well be doing this wrong. :-( Co-authored-by: kumar aditya
* gh-88863: Clear ref cycles to resolve leak when asyncio.open_connection ↵Dong Uk, Kang2022-11-22
| | | | | | | raises (#95739) Break reference cycles to resolve memory leak, by removing local exception and future instances from the frame
* GH-96704: Add {Task,Handle}.get_context(), use it in ↵Guido van Rossum2022-10-04
| | | | | call_exception_handler() (#96756) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (#97765)hetmankp2022-10-03
| | | Ensure that the event loop's `_thread_id` attribute and the asyncgen hooks set by `sys.set_asyncgen_hooks()` are always restored no matter where a KeyboardInterrupt exception is raised.
* GH-96827: Don't touch closed loops from executor threads (#96837)Guido van Rossum2022-09-30
| | | | | * When chaining futures, skip callback if loop closed. * When shutting down an executor, don't wake a closed loop.
* GH-82448: Add thread timeout for loop.shutdown_default_executor (#97561)Kumar Aditya2022-09-28
| | | | Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* gh-93973: Add all_errors to asyncio.create_connection (#93974)Pamela Fox2022-09-04
| | | | Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* Fix missing `f` prefix on f-strings (GH-91910)Alexander Shadchin2022-04-27
|
* bpo-46994: Accept explicit contextvars.Context in asyncio create_task() API ↵Andrew Svetlov2022-03-14
| | | | (GH-31837)
* bpo-46955: Expose asyncio.base_events.Server as asyncio.Server (GH-31760)Stefan Zabka2022-03-08
| | | | | | This change aligns the documentation at https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.Server with the actual implementation Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Raise TypeError if SSLSocket is passed to asyncio transport-based methods ↵Andrew Svetlov2022-02-20
| | | | (GH-31442)
* bpo-44011: New asyncio ssl implementation (#31275)Kumar Aditya2022-02-15
| | | | | | | | | | | * bpo-44011: New asyncio ssl implementation Co-Authored-By: Andrew Svetlov <andrew.svetlov@gmail.com> * fix warning * fix typo Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-23819: Fix asyncio tests on python optimized mode (GH-30195)Kumar Aditya2021-12-26
|
* Re-add `reuse_address` parameter to `create_server` (GH-29733)Jim Crist-Harif2021-12-12
| | | | | | | This parameter was accidentally removed when fixing https://bugs.python.org/issue45129, this reverts the unnecessary changes there. Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-23819: asyncio: Replace AssertionError with TypeError where it makes ↵Kumar Aditya2021-12-07
| | | | sense (GH-29894)
* bpo-45129 Remove deprecated reuse_address (GH-28207)Hugo van Kemenade2021-09-08
| | | | | | | | Due to significant security concerns, the reuse_address parameter of asyncio.loop.create_datagram_endpoint, deprecated in Python 3.9, is now removed. This is because of the behavior of the socket option SO_REUSEADDR in UDP. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44740: Lowercase "internet" and "web" where appropriate. (#27378)Mariusz Felisiak2021-07-27
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor ↵Illia Volochii2021-07-01
| | | | (GH-24540)
* bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)Pablo Galindo2021-05-03
| | | | This reverts commit 5fb06edbbb769561e245d0fe13002bab50e2ae60 and all subsequent dependent commits.
* bpo-44011: New asyncio ssl implementation (#17975)Andrew Svetlov2021-05-03
|
* bpo-42392: Remove loop parameter from asyncio.tasks and asyncio.subprocess ↵Yurii Karabas2020-11-28
| | | | (GH-23521)
* bpo-41332: Added missing connect_accepted_socket() to AbstractEventLoop ↵Alex Grönholm2020-11-26
| | | | | | (GH-21533) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com> Co-authored-by: Kyle Stanley <aeros167@gmail.com>