summaryrefslogtreecommitdiff
path: root/Lib/asyncio
Commit message (Collapse)AuthorAgeFilesLines
* asyncio: PendingDeprecationWarning -> DeprecationWarning (GH-12494)Inada Naoki2019-03-221-2/+2
| | | `Task.current_task()` and `Task.all_tasks()` will be removed in 3.9.
* bpo-34745: Fix asyncio sslproto memory issues (GH-12386)Fantix King2019-03-171-0/+4
| | | | | | | | | | | | | | * Fix handshake timeout leak in asyncio/sslproto Refs MagicStack/uvloop#222 * Break circular ref _SSLPipe <-> SSLProtocol * bpo-34745: Fix asyncio ssl memory leak * Break circular ref SSLProtocol <-> UserProtocol * Add NEWS entry
* asyncio: use dict instead of OrderedDict (GH-11710)Inada Naoki2019-02-051-1/+1
|
* bpo-23846: Fix ProactorEventLoop._write_to_self() (GH-11566)Victor Stinner2019-01-151-1/+7
| | | | | | asyncio.ProactorEventLoop now catchs and logs send errors when the self-pipe is full: BaseProactorEventLoop._write_to_self() now catchs and logs OSError exceptions, as done by BaseSelectorEventLoop._write_to_self().
* bpo-11555: Enhance IocpProactor.close() log again (GH-11563)Victor Stinner2019-01-151-3/+2
| | | | Add repr(self) to the log to display the number of pending overlapped in the log.
* bpo-34323: Enhance IocpProactor.close() log (GH-11555)Victor Stinner2019-01-151-3/+15
| | | | | IocpProactor.close() now uses time to decide when to log: wait 1 second before the first log, then log every second. Log also the number of seconds since close() was called.
* asyncio: __del__() keep reference to warnings.warn (GH-11491)Victor Stinner2019-01-107-24/+16
| | | | | | | | | | | | | | | * asyncio: __del__() keep reference to warnings.warn The __del__() methods of asyncio classes now keep a strong reference to the warnings.warn() to be able to display the ResourceWarning warning in more cases. Ensure that the function remains available if instances are destroyed late during Python shutdown (while module symbols are cleared). * Rename warn parameter to _warn "_warn" name is a hint that it's not the regular warnings.warn() function.
* IocpProactor: prevent modification if closed (GH-11494)Victor Stinner2019-01-101-6/+22
| | | | | | * _wait_for_handle(), _register() and _unregister() methods of IocpProactor now raise an exception if closed * Add "closed" to IocpProactor.__repr__() * Simplify IocpProactor.close()
* bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)Victor Stinner2019-01-081-1/+1
| | | | | | | bpo-32622, bpo-35682: Fix asyncio.ProactorEventLoop.sendfile(): don't attempt to set the result of an internal future if it's already done. Fix asyncio _ProactorBasePipeTransport._force_close(): don't set the result of _empty_waiter if it's already done.
* bpo-23057: Use 'raise' to emulate ctrl-c in proactor tests (#11274)Vladimir Matveev2019-01-051-0/+5
|
* bpo-23057: add loop self socket as wakeup fd for signals (#11135)Vladimir Matveev2018-12-182-1/+14
|
* bpo-35394: Add empty slots to abstract asyncio protocols (#10889)Andrew Svetlov2018-12-111-0/+10
| | | | | | * bpo-35394: Add empty slots to abstract asyncio protocols * Add missing test file
* bpo-35380: Enable TCP_NODELAY for proactor event loop (#10867)Andrew Svetlov2018-12-033-13/+17
|
* bpo-35202: Remove unused imports in Lib directory (GH-10450)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-151-1/+0
|
* bpo-30064: Refactor sock_* asyncio API (#10419)Andrew Svetlov2018-11-121-40/+49
|
* bpo-35065: Remove `StreamReaderProtocol._untrack_reader` (#10212)Vincent Michel2018-11-082-11/+0
| | | | | The call to `_untrack_reader` is performed too soon, causing the protocol to forget about the reader before `connection_lost` can run and feed the EOF to the reader. See bpo-35065.
* bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837)Andrew Svetlov2018-10-131-2/+6
| | | https://bugs.python.org/issue34970
* bpo-34769: Thread safety for _asyncgen_finalizer_hook(). (GH-9716)twisteroid ambassador2018-10-091-4/+1
|
* bpo-34849: Don't log wating for selector.select in asyncio loop iteration ↵Andrew Svetlov2018-09-291-22/+1
| | | | | | | | | | (GH-9641) The waiting is pretty normal for any asyncio program, logging its time just adds a noise to logs without any useful information provided. https://bugs.python.org/issue34849
* asyncio/docs: Replace Python 4.0 -> 3.10 (GH-9579)Yury Selivanov2018-09-251-6/+6
|
* bpo-34687: Make asynico use ProactorEventLoop by default (GH-9538)Victor Stinner2018-09-251-1/+1
|
* bpo-34728: Remove deprecate *loop* argument in asyncio.sleep (GH-9415)João Júnior2018-09-241-3/+16
| | | | | | | | | | | | | | | | * Insert the warn in the asyncio.sleep when the loop argument is used * Insert the warn in the asyncio.wait and asyncio.wait_for when the loop argument is used * Better format of the code * Add news file * change calls for get_event_loop() to calls for get_running_loop() * Change message to be more clear in News * Improve the comments in test_tasks
* bpo-34666: Implement stream.awrite() and stream.aclose() (GH-9274)Andrew Svetlov2018-09-131-1/+9
|
* bpo-34630: Skip logging SSL certificate errors by asyncio code (GH-9169)Andrew Svetlov2018-09-121-0/+3
|
* bpo-34638: Store a weak reference to stream reader to break strong ↵Andrew Svetlov2018-09-122-10/+86
| | | | | | | | references loop (GH-9201) Store a weak reference to stream readerfor breaking strong references It breaks the strong reference loop between reader and protocol and allows to detect and close the socket if the stream is deleted (garbage collected)
* bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)Andrew Svetlov2018-09-1112-98/+130
|
* bpo-34270: Make it possible to name asyncio tasks (GH-8547)Alex Grönholm2018-08-084-8/+41
| | | Co-authored-by: Antti Haapala <antti.haapala@anttipatterns.com>
* bpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532)MartinAltmayer2018-07-311-1/+4
|
* bpo-33833: Fix ProactorSocketTransport AssertionError (#7893)twisteroid ambassador2018-07-301-0/+4
|
* bpo-34075: Deprecate non-ThreadPoolExecutor in loop.set_default_executor() ↵Elvis Pranskevichus2018-07-301-0/+6
| | | | | | | (GH-8533) Various asyncio internals expect that the default executor is a `ThreadPoolExecutor`, so deprecate passing anything else to `loop.set_default_executor()`.
* bpo-27500: Fix static version of getaddrinfo to resolve IPv6 (GH-7993)Yury Selivanov2018-06-281-4/+10
|
* bpo-30805: Avoid race condition with debug logging (GH-7545)Yury Selivanov2018-06-081-2/+4
| | | Supersedes https://github.com/python/cpython/pull/2490
* bpo-33694: Fix typo in helper function name (GH-7522)Victor Stinner2018-06-083-3/+3
| | | | | | _feed_data_to_bufferred_proto() renamed to _feed_data_to_buffered_proto() ("bufferred" => "buffered"). Typo spotted by Nathaniel J. Smith.
* bpo-33792: Add selector and proactor windows policies (GH-7487)Yury Selivanov2018-06-071-3/+8
|
* bpo-33694: Fix race condition in asyncio proactor (GH-7498)Victor Stinner2018-06-083-145/+73
| | | | | | | | | | | | | | | | The cancellation of an overlapped WSARecv() has a race condition which causes data loss because of the current implementation of proactor in asyncio. No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport to work around the race condition. Remove the optimized recv_into() implementation to get simple implementation of pause_reading() using the single _pending_data attribute. Move _feed_data_to_bufferred_proto() to protocols.py. Remove set_protocol() method which became useless.
* bpo-33769: start_tls: Fix error message; cancel callbacks on error (GH-7403)Yury Selivanov2018-06-052-3/+6
| | | In addition to that, mark SSLTransport as "closed" in its "abort()" method to prevent bogus warnings.
* bpo-33734: asyncio/ssl: a bunch of bugfixes (#7321)Yury Selivanov2018-06-044-37/+39
| | | | | | | * Fix AttributeError (not all SSL exceptions have 'errno' attribute) * Increase default handshake timeout from 10 to 60 seconds * Make sure start_tls can be cancelled correctly * Make sure any error in SSLProtocol gets propagated (instead of just being logged)
* bpo-33238: Add InvalidStateError to concurrent.futures. (GH-7056)jhaydaman2018-05-301-6/+2
| | | | | | | Future.set_result and Future.set_exception now raise InvalidStateError if the futures are not pending or running. This mirrors the behavior of asyncio.Future, and prevents AssertionErrors in asyncio.wrap_future when set_result is called multiple times.
* Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" (#7232)Yury Selivanov2018-05-291-7/+0
| | | This reverts commit 5d97b7bcc19496617bf8c448d2f149cc28c73bc7.
* bpo-32751: Wait for task cancellation in asyncio.wait_for() (GH-7216)Elvis Pranskevichus2018-05-291-2/+21
| | | | | | | | | | | | | | | | | | | | | | | Currently, asyncio.wait_for(fut), upon reaching the timeout deadline, cancels the future and returns immediately. This is problematic for when *fut* is a Task, because it will be left running for an arbitrary amount of time. This behavior is iself surprising and may lead to related bugs such as the one described in bpo-33638: condition = asyncio.Condition() async with condition: await asyncio.wait_for(condition.wait(), timeout=0.5) Currently, instead of raising a TimeoutError, the above code will fail with `RuntimeError: cannot wait on un-acquired lock`, because `__aexit__` is reached _before_ `condition.wait()` finishes its cancellation and re-acquires the condition lock. To resolve this, make `wait_for` await for the task cancellation. The tradeoff here is that the `timeout` promise may be broken if the task decides to handle its cancellation in a slow way. This represents a behavior change and should probably not be back-patched to 3.6 and earlier.
* bpo-32684: Fix gather to propagate cancel of itself with return_exceptions ↵Yury Selivanov2018-05-291-1/+13
| | | | (GH-7209)
* bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)Yury Selivanov2018-05-291-0/+7
| | | | Original patch by Dan O'Reilly.
* bpo-33353: test_asyncio use set_write_buffer_limits() (GH-7200)Victor Stinner2018-05-291-1/+1
| | | | | | | Use transport.set_write_buffer_limits() in sendfile tests of test_asyncio to make sure that the protocol is paused after sending 4 KiB. Previously, test_sendfile_fallback_close_peer_in_the_middle_of_receiving() failed on FreeBSD if the DATA was smaller than the default limit of 64 KiB.
* bpo-33654: Support protocol type switching in SSLTransport.set_protocol() ↵Yury Selivanov2018-05-291-4/+7
| | | | (#7194)
* bpo-33674: Pause the transport as early as possible (#7192)Yury Selivanov2018-05-291-2/+5
|
* bpo-33674: asyncio: Fix SSLProtocol race (GH-7175)Victor Stinner2018-05-291-1/+1
| | | | | | Fix a race condition in SSLProtocol.connection_made() of asyncio.sslproto: start immediately the handshake instead of using call_soon(). Previously, data_received() could be called before the handshake started, causing the handshake to hang or fail.
* bpo-32410: Avoid blocking on file IO in sendfile fallback code (GH-7172)Yury Selivanov2018-05-282-2/+9
|
* bpo-32610: Fix asyncio.all_tasks() to return only pending tasks. (GH-7174)Yury Selivanov2018-05-283-3/+16
|
* bpo-33469: RuntimeError after closing loop that used run_in_executor (GH-7171)Yury Selivanov2018-05-281-0/+3
|
* bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines (GH-7161)Yury Selivanov2018-05-282-40/+50
|