| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
Patch by Gustavo J. A. M. Carneiro.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Issue #24763: Fix resource warnings when asyncio.BaseSubprocessTransport
constructor fails, if subprocess.Popen raises an exception for example.
Patch written by Martin Richard, test written by me.
|
|
|
|
|
|
|
|
|
| |
* Fix ResourceWarning warnings in test_streams
* Return True from StreamReader.eof_received() to fix
http://bugs.python.org/issue24539 (but still needs a unittest).
Add StreamReader.__repr__() for easy debugging.
* remove unused imports
* Issue #234: Drop JoinableQueue on Python 3.5+
|
|
|
|
|
| |
Move compatibility helpers for the different Python versions to a new
asyncio.compat module.
|
|
|
|
|
| |
* queues: get coroutine from asyncio.coroutines, not from asyncio.tasks
* tets: replace tulip with asyncio in comments
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
See also issue 24017.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
running.
Previous approach of installing coroutine wrapper in loop.set_debug() and
uninstalling it in loop.close() was very fragile. Most of asyncio tests
do not call loop.close() at all. Since coroutine wrapper is a global
setting, we have to make sure that it's only set when the loop is
running, and is automatically unset when it stops running.
Issue #24017.
|
| |
|
| |
|
| |
|
|
|
|
| |
without __name__.
|
| |
|
|
|
|
|
|
|
|
| |
again if the first call to connect() raises an InterruptedError.
When the C function connect() fails with EINTR, the connection runs in
background. We have to wait until the socket becomes writable to be notified
when the connection succeed or fails.
|
| |
|
| |
|
|
|
|
|
| |
Replace "running" with "not started" and don't show the pid if the subprocess
didn't start yet.
|
|
|
|
| |
Methods only raise NotImplementedError and are never used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Merge JoinableQueue with Queue. To more closely match the standard Queue,
asyncio.Queue has "join" and "task_done". JoinableQueue is deleted.
Docstring for Queue.join shouldn't mention threads.
Restore JoinableQueue as a deprecated alias for Queue. To more closely match
the standard Queue, asyncio.Queue has "join" and "task_done". JoinableQueue
remains as a deprecated alias for Queue to avoid needlessly breaking too much
code that depended on it.
Patch written by A. Jesse Jiryu Davis <jesse@mongodb.com>.
|
|
|
|
| |
running
|
|
|
|
| |
already finished
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* _check_resolved_address() is implemented with getaddrinfo() which is slow
* If available, use socket.inet_pton() instead of socket.getaddrinfo(), because
it is much faster
Microbenchmark (timeit) on Fedora 21 (Python 3.4, Linux 3.17, glibc 2.20) to
validate the IPV4 address "127.0.0.1" or the IPv6 address "::1":
* getaddrinfo() 10.4 usec per loop
* inet_pton(): 0.285 usec per loop
On glibc older than 2.14, getaddrinfo() always requests the list of all local
IP addresses to the kernel (using a NETLINK socket). getaddrinfo() has other
known issues, it's better to avoid it when it is possible.
|
|
|
|
|
| |
Just try to be consistent: _debug was already used in some places, and always
used in BaseProactorEventLoop.
|
| |
|
|
|
|
|
| |
Don't use yield/yield-from in an except block of a generator. Store the
exception and handle it outside the except block.
|
|
|
|
|
|
|
| |
transport was closed. The check broken a Tulip example and this limitation is
arbitrary. Check if _proc is None should be enough.
Enhance also close(): do nothing when called the second time.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #23347: send_signal(), kill() and terminate() methods of
BaseSubprocessTransport now check if the transport was closed and if the
process exited.
Issue #23347: Refactor creation of subprocess transports. Changes on
BaseSubprocessTransport:
* Add a wait() method to wait until the child process exit
* The constructor now accepts an optional waiter parameter. The _post_init()
coroutine must not be called explicitly anymore. It makes subprocess
transports closer to other transports, and it gives more freedom if we want
later to change completly how subprocess transports are created.
* close() now kills the process instead of kindly terminate it: the child
process may ignore SIGTERM and continue to run. Call explicitly terminate()
and wait() if you want to kindly terminate the child process.
* close() now logs a warning in debug mode if the process is still running and
needs to be killed
* _make_subprocess_transport() is now fully asynchronous again: if the creation
of the transport failed, wait asynchronously for the process eixt. Before the
wait was synchronous. This change requires close() to *kill*, and not
terminate, the child process.
* Remove the _kill_wait() method, replaced with a more agressive close()
method. It fixes _make_subprocess_transport() on error.
BaseSubprocessTransport.close() calls the close() method of pipe transports,
whereas _kill_wait() closed directly pipes of the subprocess.Popen object
without unregistering file descriptors from the selector (which caused severe
bugs).
These changes simplifies the code of subprocess.py.
|
|
|
|
| |
is not explicitly closed. Close also explicitly transports in test_sslproto.
|
|
|
|
|
|
|
|
|
| |
* Cleanup gather(): use cancelled() method instead of using private Future
attribute
* Fix _UnixReadPipeTransport and _UnixWritePipeTransport. Only start reading
when connection_made() has been called.
* Issue #23333: Fix BaseSelectorEventLoop._accept_connection(). Close the
transport on error. In debug mode, log errors using call_exception_handler()
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* _SelectorTransport constructor: extra parameter is now optional
* Fix _SelectorDatagramTransport constructor. Only start reading after
connection_made() has been called.
* Fix _SelectorSslTransport.close(). Don't call protocol.connection_lost() if
protocol.connection_made() was not called yet: if the SSL handshake failed or
is still in progress. The close() method can be called if the creation of the
connection is cancelled, by a timeout for example.
|
|
|
|
| |
close() closes pipes, which is not None yet by _kill_wait().
|
|
|
|
|
| |
Only start reading when connection_made() has been called:
protocol.data_received() must not be called before protocol.connection_made().
|
|
|
|
|
|
|
| |
* Rephrase also the comment explaining why the waiter is not awaken immediatly.
* SSLProtocol.eof_received() doesn't instanciate ConnectionResetError exception
directly, it will be done by Future.set_exception(). The exception is not
used if the waiter was cancelled or if there is no waiter.
|
|
|
|
| |
Wake-up the waiter if it is not done yet.
|