Miss Islington (bot)
19518a4205
[3.14] gh-136447: Use self.loop
instead of global loop
variable in asyncio REPL (GH-136448) ( #136458 )
...
Tests / Windows MSI (push) Blocked by required conditions
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / (push) Blocked by required conditions
Tests / Check if the ABI has changed (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
gh-136447: Use `self.loop` instead of global `loop` variable in asyncio REPL (GH-136448)
(cherry picked from commit 77fa7a4dcc
)
Co-authored-by: Justin Su <injustsu@gmail.com>
2025-07-09 09:23:43 +00:00
Miss Islington (bot)
c29fce05f3
[3.14] gh-134657: Remove newly added private names from asyncio.__all__ (GH-134665) ( #136455 )
...
gh-134657: Remove newly added private names from asyncio.__all__ (GH-134665)
(cherry picked from commit 797abd1f7f
)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-07-09 08:34:19 +00:00
Miss Islington (bot)
5216a6c547
[3.14] gh-135836: Fix IndexError
in asyncio.create_connection()
(GH-135875) ( #136221 )
...
gh-135836: Fix `IndexError` in `asyncio.create_connection()` (GH-135875)
(cherry picked from commit 9084b15156
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-07-03 04:34:30 +00:00
Miss Islington (bot)
8810ccfc60
[3.14] gh-135836: Fix IndexError
in asyncio.create_connection
with empty exceptions list (GH-135845) ( #136167 )
...
gh-135836: Fix `IndexError` in `asyncio.create_connection` with empty exceptions list (GH-135845)
(cherry picked from commit 0e19db653d
)
Co-authored-by: heliang666s <147408835+heliang666s@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-03 09:37:18 +05:30
Miss Islington (bot)
f8f99b1cfc
[3.14] gh-135371: Fix asyncio introspection output to include internal coroutine chains (GH-135436) ( #135509 )
...
gh-135371: Fix asyncio introspection output to include internal coroutine chains (GH-135436)
(cherry picked from commit 028309fb47
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-06-15 18:38:56 +00:00
Pablo Galindo Salgado
1822f33b1a
[3.14] gh-91048: Refactor and optimize remote debugging module ( #134652 ) ( #134673 )
...
gh-91048: Refactor and optimize remote debugging module (#134652 )
Completely refactor Modules/_remote_debugging_module.c with improved
code organization, replacing scattered reference counting and error
handling with centralized goto error paths. This cleanup improves
maintainability and reduces code duplication throughout the module while
preserving the same external API.
Implement memory page caching optimization in Python/remote_debug.h to
avoid repeated reads of the same memory regions during debugging
operations. The cache stores previously read memory pages and reuses
them for subsequent reads, significantly reducing system calls and
improving performance.
Add code object caching mechanism with a new code_object_generation
field in the interpreter state that tracks when code object caches need
invalidation. This allows efficient reuse of parsed code object metadata
and eliminates redundant processing of the same code objects across
debugging sessions.
Optimize memory operations by replacing multiple individual structure
copies with single bulk reads for the same data structures. This reduces
the number of memory operations and system calls required to gather
debugging information from the target process.
Update Makefile.pre.in to include Python/remote_debug.h in the headers
list, ensuring that changes to the remote debugging header force proper
recompilation of dependent modules and maintain build consistency across
the codebase.
Also, make the module compatible with the free threading build as an extra :)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 42b25ad4d3
)
2025-05-25 22:10:20 +00:00
Miss Islington (bot)
73967c4c01
[3.14] gh-134451: Converted asyncio.tools.CycleFoundException
from dataclass to a regular exception type. (GH-134513) ( #134564 )
...
gh-134451: Converted `asyncio.tools.CycleFoundException` from dataclass to a regular exception type. (GH-134513)
(cherry picked from commit f9324cb3cb
)
Co-authored-by: Evgeny Demchenko <v1mpire@icloud.com>
2025-05-23 05:40:56 +00:00
Miss Islington (bot)
c67eb41a3b
[3.14] gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess (GH-134508) ( #134561 )
...
gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess (GH-134508)
(cherry picked from commit 5804ee7b46
)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-23 04:58:51 +00:00
Miss Islington (bot)
f1a9d89107
[3.14] gh-90871: fix connection backlog offset in asyncio (gh-134392) (gh-134421)
...
(cherry picked from commit 109f7597d2
)
Co-authored-by: Christian Harries <68507104+ChristianHrs@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-21 16:27:13 +02:00
Miss Islington (bot)
efdaae5b35
[3.14] gh-86802: Fix asyncio memory leak; shielded task exceptions log once through the exception handler (gh-134331) (gh-134343)
...
(cherry picked from commit f695eca60c
)
Co-authored-by: Christian Harries <68507104+ChristianHrs@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 19:43:09 +02:00
Miss Islington (bot)
507715d5f7
[3.14] gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (GH-133894) ( #133901 )
...
gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (GH-133894)
(cherry picked from commit 1d3eacedb8
)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2025-05-11 15:25:43 +00:00
Łukasz Langa
60cdd800d9
gh-91048: Add filename:line_no information to asyncio pstree
( #133478 )
2025-05-05 23:07:33 +00:00
Łukasz Langa
f610bbdf74
gh-133346: Make theming support in _colorize extensible (GH-133347)
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-05 23:45:25 +02:00
Thomas Grainger
08d7687094
gh-128307: Support eager_start=<bool> in create_eager_task_factory and 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>
2025-05-05 04:58:07 +00:00
Adam Turner
3f80165a26
GH-91048: Minor fixes for `_remotedebugging
& rename to
_remote_debugging
` ( #133398 )
2025-05-05 02:30:14 +02:00
Pablo Galindo Salgado
3109c47be8
gh-91048: Add filename and line number to external inspection routines (GH-133385)
...
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2025-05-04 23:33:37 +02:00
Pablo Galindo Salgado
2bc8365231
GH-91048: Add utils for printing the call stack for asyncio tasks ( #133284 )
2025-05-04 00:51:57 +00:00
Kumar Aditya
ce753517a8
gh-86513: improve docs of loop.call_exception_handler ( #132466 )
2025-04-13 21:39:24 +00:00
Kumar Aditya
05d27a84f4
gh-130322: drop deprecation of asyncio.set_event_loop
( #132349 )
2025-04-12 12:03:52 +05:30
Stan Ulbrych
a214db0c54
gh-132307: Remove unnecessary check in asyncio/base_events.py
( #132324 )
2025-04-10 15:41:32 +00:00
Kumar Aditya
94f4d87aeb
gh-131325: fix sendfile fallback implementation to drain data after writing to transport ( #131376 )
2025-03-18 00:52:57 +05:30
Kumar Aditya
7e3b788e8f
gh-128002: use efficient linked list implementation for eager tasks in asyncio ( #130518 )
2025-03-03 06:36:43 +00:00
Kumar Aditya
38d45d23a6
gh-129874: avoid mixing pure python and C impl in eager execution ( #130515 )
2025-02-24 15:37:59 +00:00
Bartosz Sławecki
7ed3dc6392
gh-128231: Use runcode()
return value for failing early (GH-129488)
2025-02-24 15:50:13 +01:00
Kumar Aditya
660f126f87
gh-129898: per-thread current task implementation in asyncio ( #129899 )
...
Store the current running task on the thread state, it makes it thread safe for the free-threading build and while improving performance as there is no lock contention, this effectively makes it lock free.
When accessing the current task of the current running loop in current thread, no locking is required and can be acessed without locking.
In the rare case of accessing current task of a loop running in a different thread, the stop the world pauses is used in free-threading builds to stop all other running threads and find the task for the specified loop.
This also makes it easier for external introspection to find the current task, and now it will be always correct.
2025-02-19 16:34:49 +00:00
Kumar Aditya
a545749b0e
gh-130145: fix loop.run_forever
when loop is already running ( #130146 )
2025-02-15 15:01:53 +05:30
Kumar Aditya
d5796e64e0
gh-129874: avoid mixing pure python and C implementation of asyncio ( #129875 )
2025-02-09 15:57:00 +05:30
Vojtěch Boček
4e38eeafe2
gh-115514: Fix incomplete writes after close while using ssl in asyncio( #128037 )
...
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-02-02 15:11:25 +00:00
Stan Ulbrych
bcb25d60b1
gh-129403: Fix ValueError
messages in asyncio.Barrier
and threading.Barrier
( #129419 )
...
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-01-30 11:11:12 +03:00
Thomas Grainger
fccbfc40b5
gh-129195: use future_add_to_awaited_by/future_discard_from_awaited_by
in asyncio.staggered.staggered_race
( #129253 )
...
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-26 21:14:16 +05:30
Thomas Grainger
ec91e1c276
gh-128479: fix asyncio staggered race leaking tasks, and logging unhandled exception.append exception ( #128475 )
...
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-01-23 16:53:53 +01:00
Yury Selivanov
188598851d
GH-91048: Add utils for capturing async call stack for asyncio programs and enable profiling ( #124640 )
...
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Co-authored-by: Jacob Coffee <jacob@z7x.org>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-01-22 17:25:29 +01:00
Thomas Grainger
ed6934e71e
gh-128588: gh-128550: remove eager tasks optimization that missed and introduced incorrect cancellations ( #129063 )
...
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-20 17:13:01 +00:00
Thomas Grainger
38a9956876
gh-128308: pass **kwargs
to asyncio task_factory ( #128768 )
...
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-20 22:23:55 +05:30
Michał Górny
3829104ab4
gh-128916: Do not set SO_REUSEPORT
on non-AF_INET*
sockets (GH-128933)
...
* 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>
2025-01-17 16:49:16 -08:00
Wang Ran (汪然)
1a1056d394
Fix typo in Lib/asyncio/futures.py
( #128819 )
2025-01-15 17:54:31 +05:30
Thomas Grainger
61b9811ac6
gh-128552: fix refcycles in eager task creation ( #128553 )
2025-01-07 11:44:57 +00:00
Michael H
7363476b64
gh-128559: Remove typing import from asyncio.timeouts ( #128560 )
2025-01-06 15:03:27 -08:00
Kumar Aditya
7e8c571604
gh-128340: add thread safe handle for loop.call_soon_threadsafe
( #128369 )
...
Adds `_ThreadSafeHandle` to be used for callbacks scheduled with `loop.call_soon_threadsafe`.
2025-01-06 18:05:11 +05:30
jb2170
830e10651b
gh-127529: Correct asyncio's accept_connection
behaviour for handling ConnectionAbortedError
( #127532 )
...
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-03 10:32:36 +00:00
Andrew Svetlov
0b5f1fae57
Mention loop_factory argument in docstring for asyncio.run() ( #128288 )
2024-12-27 14:58:35 +01:00
Kumar Aditya
9fce906825
gh-127949: deprecate asyncio.set_event_loop
( #128218 )
...
Deprecate `asyncio.set_event_loop` to be removed in Python 3.16.
2024-12-24 19:24:28 +05:30
Kumar Aditya
a391d80f4b
gh-127949: deprecate asyncio policy classes ( #128216 )
2024-12-24 17:30:26 +05:30
Kumar Aditya
dbd08fb60d
gh-127949: deprecate asyncio.get_event_loop_policy
( #128053 )
...
This deprecates `asyncio.get_event_loop_policy` and will be removed in Python 3.16.
2024-12-18 18:04:20 +05:30
Kumar Aditya
5892853fb7
gh-127949: deprecate asyncio.set_event_loop_policy
( #128024 )
...
First step towards deprecating the asyncio policy system.
This deprecates `asyncio.set_event_loop_policy` and will be removed in Python 3.16.
2024-12-18 11:35:29 +05:30
J. Nick Koston
e991ac8f20
gh-127655: Ensure _SelectorSocketTransport.writelines
pauses the protocol if needed ( #127656 )
...
Ensure `_SelectorSocketTransport.writelines` pauses the protocol if it reaches the high water mark as needed.
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-12-06 10:03:03 +05:30
Kumar Aditya
fe5a6ab7be
gh-126353: remove implicit creation of loop from asyncio.get_event_loop
( #126354 )
...
Remove implicit creation of loop from `asyncio.get_event_loop`. This is a step forward of deprecating the policy system of asyncio.
2024-11-04 14:21:20 +05:30
Javad Shafique
3f24bde0b6
gh-118950: Fix SSLProtocol.connection_lost not being called when OSError is thrown ( #118960 )
...
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-10-24 17:41:16 +00:00
Thomas Grainger
0b28ea4a35
gh-124958: Revert "gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles ... ( #125486 )
...
* Revert "gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#12… (#125476 )"
This reverts commit e99650b80a
.
* fix incompatability with gh-124392
2024-10-14 15:45:58 -07:00
Kirill Podoprigora
e99650b80a
gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#12… ( #125476 )
...
Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959 )"
This reverts commit d5dbbf4372
.
2024-10-14 17:59:13 +00:00