Commit graph

1089 commits

Author SHA1 Message Date
Christian Harries
109f7597d2
gh-90871: fix connection backlog offset in asyncio (gh-134392)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-21 15:59:09 +02:00
Christian Harries
f695eca60c
gh-86802: Fix asyncio memory leak; shielded task exceptions log once through the exception handler (gh-134331)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 17:14:27 +02:00
J. Nick Koston
53da1e8c8c
gh-134173: optimize state transfer between concurrent.futures.Future and asyncio.Future (#134174)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-18 21:26:20 +05:30
Serhiy Storchaka
14305a83d3
gh-133677: Fix tests when running in non-UTF-8 locale (GH-133865) 2025-05-12 19:09:11 +03:00
Serhiy Storchaka
26839eae20
gh-133454: Mark tests with many threads that use much memory as bigmem (GH-133456) 2025-05-08 15:57:30 +03:00
Łukasz Langa
60cdd800d9
gh-91048: Add filename:line_no information to asyncio pstree (#133478) 2025-05-05 23:07:33 +00: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
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
Serhiy Storchaka
84a08f8629
gh-133306: Use \z instead of \Z in regular expressions in the stdlib (GH-133337) 2025-05-03 17:58:49 +03:00
John
8d6d7386a3
gh-133016: Fix a reference to removed asyncio.futures.TimeoutError (#133019)
Just use the builtin `TimeoutError`, and remove the import of `futures`.
2025-04-26 18:57:08 +00:00
Kumar Aditya
05d27a84f4
gh-130322: drop deprecation of asyncio.set_event_loop (#132349) 2025-04-12 12:03:52 +05:30
alexey semenyuk
27d1443897
Use assert* comparison methods in test_timer_comparison (#129513) 2025-03-28 14:25:13 +00:00
Thomas Grainger
71ce4acb25
gh-131645: fix ResourceWarnings in test_asyncio.test_events (#131646) 2025-03-24 12:38:33 +00:00
Kumar Aditya
ab6333f7f5
gh-128002: fix tsan race in closing socket in test_sslproto (#131399) 2025-03-18 16:20:47 +05:30
Kumar Aditya
b0a4f6599a
gh-128002: fix tsan race in closing socket in test_ssl (#131397) 2025-03-18 15:41:43 +05:30
Victor Stinner
73ab9e2ede
gh-131152: Remove unused imports from tests (#131153) 2025-03-13 10:55:23 +01:00
Kumar Aditya
fcf756adef
fix various warnings in test_asyncio.test_tasks (#131109) 2025-03-11 19:51:53 +00:00
Victor Stinner
6c48ed7d62
gh-130736: Fix asyncio test_shutdown_default_executor_timeout() (#130800)
Replace time.sleep() with threading.Event.
2025-03-04 11:16:07 +00:00
Kumar Aditya
d73d69e232
gh-129874: improve tests to use correct implementations in asyncio (#130516) 2025-02-24 21:33:52 +05:30
Kumar Aditya
2e3e65380b
improve test_tasks to use correct idiom for starting task in asyncio (#130257)
The test should use the correct idiom for starting the task, `loop._run_once` is private API which should not be used directly, instead use `asyncio.sleep(0)` for 1 event loop cycle.
2025-02-18 12:08:25 +00:00
AN Long
798f8d3ea9
Replace non-breaking spaces with normal spaces (#130116)
Using normal spaces in place of non-breaking spaces.
2025-02-16 09:33:14 +08: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
94cd2e0dde
gh-129289: fix crash when task finalizer is not called in asyncio (#129840) 2025-02-10 17:03:59 +05:30
Kumar Aditya
f7c7decc4c
gh-129874: improve test_events to use correct task implementation (#129891) 2025-02-09 18:36:16 +05:30
Kumar Aditya
ce0cf7a73a
gh-129874: improve test_tasks in asyncio to use correct internal functions (#129890) 2025-02-09 13:02:11 +00:00
Kumar Aditya
09fe550ecc
gh-129874: improve asyncio tests to use correct internal functions (#129887) 2025-02-09 12:05:39 +00:00
Kumar Aditya
49bd47d5f1
improve test_log_destroyed_pending_task in asyncio (#129821) 2025-02-07 18:00:59 +00:00
Kumar Aditya
f52a3a51eb
fix tests in test_asyncio.test_tasks to use correct all_tasks (#129815) 2025-02-07 21:46:26 +05:30
Kumar Aditya
0d68b14a0d
gh-128002: use per threads tasks linked list in asyncio (#128869)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-02-06 19:51:07 +01:00
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
Kumar Aditya
e635bf2e49
gh-128002: fix test_all_tasks_different_thread in asyncio (#129267) 2025-01-24 23:10:24 +05:30
Kumar Aditya
8e0b36006c
gh-128002: use _PyObject_SetMaybeWeakref when creating tasks in asyncio (#128885) 2025-01-24 21:12:56 +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
Łukasz Langa
2ed5ee9a50
gh-129158: Fix unwanted trailing whitespace in test_asyncio.test_subprocess (#129181) 2025-01-22 13:52:45 +00:00
Pablo Galindo Salgado
a9f5edbf5f
gh-129158: Ensure we restore unix_events.can_use_pidfd after SubprocessThreadedWatcherTests finishes (#129160) 2025-01-22 12:25:42 +00: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
Serhiy Storchaka
c6b570e5e3
gh-71339: Use new assertion methods in test_asyncio (#129051) 2025-01-20 17:02:39 +05:30
Kumar Aditya
3efe28a40b
gh-128002: add more thread safety tests for asyncio (#128480) 2025-01-13 15:36:55 +00:00
Thomas Grainger
61b9811ac6
gh-128552: fix refcycles in eager task creation (#128553) 2025-01-07 11:44:57 +00: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
Kumar Aditya
513a4efa75
gh-128002: fix many thread safety issues in asyncio (#128147)
* Makes `_asyncio.Task` and `_asyncio.Future` thread-safe by adding critical sections
* Add assertions to check for thread safety checking locking of object by critical sections in internal functions
* Make `_asyncio.all_tasks` thread safe when eager tasks are used
* Add a thread safety test
2025-01-04 14:18:22 +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
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
Thomas Grainger
b66a4ad9fc
gh-127949: fix resource warnings in test_tasks.py (#128172) 2024-12-22 18:16:02 +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