forked from python/asyncio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog
338 lines (254 loc) · 12.5 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
Tulip 3.4.4
===========
* Issue #234: Drop asyncio.JoinableQueue on Python 3.5 and newer
2015-02-04: Tulip 3.4.3
=======================
Major changes
-------------
* New SSL implementation using ssl.MemoryBIO. The new implementation requires
Python 3.5 and newer, otherwise the legacy implementation is used.
* On Python 3.5 and newer usable, the ProactorEventLoop now supports SSL
thanks to the new SSL implementation.
* Fix multiple resource leaks: close sockets on error, explicitly clear
references, emit ResourceWarning when event loops and transports are not
closed explicitly, etc.
* The proactor event loop is now much more reliable (no more known race
condition).
* Enhance handling of task cancellation.
Changes of the asyncio API
--------------------------
* Export BaseEventLoop symbol in the asyncio namespace
* create_task(), call_soon(), call_soon_threadsafe(), call_later(),
call_at() and run_in_executor() methods of BaseEventLoop now raise an
exception if the event loop is closed.
* call_soon(), call_soon_threadsafe(), call_later(), call_at() and
run_in_executor() methods of BaseEventLoop now raise an exception if the
callback is a coroutine object.
* BaseEventLoopPolicy.get_event_loop() now always raises a RuntimeError
if there is no event loop in the curren thread, instead of using an
assertion (which can be disabld at runtime) and so raises an AssertionError.
* selectors: Selector.get_key() now raises an exception if the selector is
closed.
* If wait_for() is cancelled, the waited task is also cancelled.
* _UnixSelectorEventLoop.add_signal_handler() now raises an exception if
the callback is a coroutine object or a coroutine function. It also raises
an exception if the event loop is closed.
Performances
------------
* sock_connect() doesn't check if the address is already resolved anymore.
The check is only done in debug mode. Moreover, the check uses inet_pton()
instead of getaddrinfo(), if inet_pton() is available, because getaddrinfo()
is slow (around 10 us per call).
Debug
-----
* Better repr() of _ProactorBasePipeTransport, _SelectorTransport,
_UnixReadPipeTransport and _UnixWritePipeTransport: add closed/closing
status and the file descriptor
* Add repr(PipeHandle)
* PipeHandle destructor now emits a ResourceWarning is the pipe is not closed
explicitly.
* In debug mode, call_at() method of BaseEventLoop now raises an exception
if called from the wrong thread (not from the thread running the event
loop). Before, it only raised an exception if current thread had an event
loop.
* A ResourceWarning is now emitted when event loops and transports are
destroyed before being closed.
* BaseEventLoop.call_exception_handler() now logs the traceback where
the current handle was created (if no source_traceback was specified).
* BaseSubprocessTransport.close() now logs a warning when the child process is
still running and the method kills it.
Bug fixes
---------
* windows_utils.socketpair() now reuses socket.socketpair() if available
(Python 3.5 or newer).
* Fix IocpProactor.accept_pipe(): handle ERROR_PIPE_CONNECTED, it means
that the pipe is connected. _overlapped.Overlapped.ConnectNamedPipe() now
returns True on ERROR_PIPE_CONNECTED.
* Rewrite IocpProactor.connect_pipe() using polling to avoid tricky bugs
if the connection is cancelled, instead of using QueueUserWorkItem() to run
blocking code.
* Fix IocpProactor.recv(): handle BrokenPipeError, set the result to an empty
string.
* Fix ProactorEventLoop.start_serving_pipe(): if a client connected while the
server is closing, drop the client connection.
* Fix a tricky race condition when IocpProactor.wait_for_handle() is
cancelled: wait until the wait is really cancelled before destroying the
overlapped object. Unregister also the overlapped operation to not block
in IocpProactor.close() before the wait will never complete.
* Fix _UnixSubprocessTransport._start(): make the write end of the stdin pipe
non-inheritable.
* Set more attributes in the body of classes to avoid attribute errors in
destructors if an error occurred in the constructor.
* Fix SubprocessStreamProtocol.process_exited(): close the transport
and clear its reference to the transport.
* Fix SubprocessStreamProtocol.connection_made(): set the transport of
stdout and stderr streams to respect reader buffer limits (stop reading when
the buffer is full).
* Fix FlowControlMixin constructor: if the loop parameter is None, get the
current event loop.
* Fix selectors.EpollSelector.select(): don't fail anymore if no file
descriptor is registered.
* Fix _SelectorTransport: don't wakeup the waiter if it was cancelled
* Fix _SelectorTransport._call_connection_lost(): only call connection_lost()
if connection_made() was already called.
* Fix BaseSelectorEventLoop._accept_connection(): close the transport on
error. In debug mode, log errors (ex: SSL handshake failure) on the creation
of the transport for incoming connection.
* Fix BaseProactorEventLoop.close(): stop the proactor before closing the
event loop because stopping the proactor may schedule new callbacks, which
is now forbidden when the event loop is closed.
* Fix wrap_future() to not use a free variable and so not keep a frame alive
too long.
* Fix formatting of the "Future/Task exception was never retrieved" log: add
a newline before the traceback.
* WriteSubprocessPipeProto.connection_lost() now clears its reference to the
subprocess.Popen object.
* If the creation of a subprocess transport fails, the child process is killed
and the event loop waits asynchronously for its completion.
* BaseEventLoop.run_until_complete() now consumes the exception to not log a
warning when a BaseException like KeyboardInterrupt is raised and
run_until_complete() is not a future (but a coroutine object).
* create_connection(), create_datagram_endpoint(), connect_read_pipe() and
connect_write_pipe() methods of BaseEventLoop now close the transport on
error.
Other changes
-------------
* Add tox.ini to run tests using tox.
* _FlowControlMixin constructor now requires an event loop.
* Embed asyncio/test_support.py to not depend on test.support of the system
Python. For example, test.support is not installed by default on Windows.
* selectors.Selector.close() now clears its reference to the mapping object.
* _SelectorTransport and _UnixWritePipeTransport now only starts listening for
read events after protocol.connection_made() has been called
* _SelectorTransport._fatal_error() now only logs ConnectionAbortedError
in debug mode.
* BaseProactorEventLoop._loop_self_reading() now handles correctly
CancelledError (just exit) and logs an error for other exceptions.
* _ProactorBasePipeTransport now clears explicitly references to read and
write future and to the socket
* BaseSubprocessTransport constructor now calls the internal _connect_pipes()
method (previously called _post_init()). The constructor now accepts an
optional waiter parameter to notify when the transport is ready.
* send_signal(), terminate() and kill() methods of BaseSubprocessTransport now
raise a ProcessLookupError if the process already exited.
* Add run_aiotest.py to run the aiotest test suite
* Add release.py script to build wheel packages on Windows and run unit tests
2014-09-30: Tulip 3.4.2
=======================
New shiny methods like create_task(), better documentation, much better debug
mode, better tests.
asyncio API
-----------
* Add BaseEventLoop.create_task() method: schedule a coroutine object.
It allows other asyncio implementations to use their own Task class to
change its behaviour.
* New BaseEventLoop methods:
- create_task(): schedule a coroutine
- get_debug()
- is_closed()
- set_debug()
* Add _FlowControlMixin.get_write_buffer_limits() method
* sock_recv(), sock_sendall(), sock_connect(), sock_accept() methods of
SelectorEventLoop now raise an exception if the socket is blocking mode
* Include unix_events/windows_events symbols in asyncio.__all__.
Examples: SelectorEventLoop, ProactorEventLoop, DefaultEventLoopPolicy.
* attach(), detach(), loop, active_count and waiters attributes of the Server
class are now private
* BaseEventLoop: run_forever(), run_until_complete() now raises an exception if
the event loop was closed
* close() now raises an exception if the event loop is running, because pending
callbacks would be lost
* Queue now accepts a float for the maximum size.
* Process.communicate() now ignores BrokenPipeError and ConnectionResetError
exceptions, as Popen.communicate() of the subprocess module
Performances
------------
* Optimize handling of cancelled timers
Debug
-----
* Future (and Task), CoroWrapper and Handle now remembers where they were
created (new _source_traceback object), traceback displayed when errors are
logged.
* On Python 3.4 and newer, Task destrutor now logs a warning if the task was
destroyed while it was still pending. It occurs if the last reference
to the task was removed, while the coroutine didn't finish yet.
* Much more useful events are logged:
- Event loop closed
- Network connection
- Creation of a subprocess
- Pipe lost
- Log many errors previously silently ignored
- SSL handshake failure
- etc.
* BaseEventLoop._debug is now True if the envrionement variable
PYTHONASYNCIODEBUG is set
* Log the duration of DNS resolution and SSL handshake
* Log a warning if a callback blocks the event loop longer than 100 ms
(configurable duration)
* repr(CoroWrapper) and repr(Task) now contains the current status of the
coroutine (running, done), current filename and line number, and filename and
line number where the object was created
* Enhance representation (repr) of transports: add the file descriptor, status
(idle, polling, writing, etc.), size of the write buffer, ...
* Add repr(BaseEventLoop)
* run_until_complete() doesn't log a warning anymore when called with a
coroutine object which raises an exception.
Bugfixes
--------
* windows_utils.socketpair() now ensures that sockets are closed in case
of error.
* Rewrite bricks of the IocpProactor() to make it more reliable
* IocpProactor destructor now closes it.
* _OverlappedFuture.set_exception() now cancels the overlapped operation.
* Rewrite _WaitHandleFuture:
- cancel() is now able to signal the cancellation to the overlapped object
- _unregister_wait() now catchs and logs exceptions
* PipeServer.close() (class used on Windows) now cancels the accept pipe
future.
* Rewrite signal handling in the UNIX implementation of SelectorEventLoop:
use the self-pipe to store pending signals instead of registering a
signal handler calling directly _handle_signal(). The change fixes a
race condition.
* create_unix_server(): close the socket on error.
* Fix wait_for()
* Rewrite gather()
* drain() is now a classic coroutine, no more special return value (empty
tuple)
* Rewrite SelectorEventLoop.sock_connect() to handle correctly timeout
* Process data of the self-pipe faster to accept more pending events,
especially signals written by signal handlers: the callback reads all pending
data, not only a single byte
* Don't try to set the result of a Future anymore if it was cancelled
(explicitly or by a timeout)
* CoroWrapper now works around CPython issue #21209: yield from & custom
generator classes don't work together, issue with the send() method. It only
affected asyncio in debug mode on Python older than 3.4.2
Misc changes
------------
* windows_utils.socketpair() now supports IPv6.
* Better documentation (online & docstrings): fill remaining XXX, more examples
* new asyncio.coroutines submodule, to ease maintenance with the trollius
project: @coroutine, _DEBUG, iscoroutine() and iscoroutinefunction() have
been moved from asyncio.tasks to asyncio.coroutines
* Cleanup code, ex: remove unused attribute (ex: _rawsock)
* Reuse os.set_blocking() of Python 3.5.
* Close explicitly the event loop in Tulip examples.
* runtests.py now mention if tests are running in release or debug mode.
2014-05-19: Tulip 3.4.1
=======================
2014-02-24: Tulip 0.4.1
=======================
2014-02-10: Tulip 0.3.1
=======================
* Add asyncio.subprocess submodule and the Process class.
2013-11-25: Tulip 0.2.1
=======================
* Add support of subprocesses using transports and protocols.
2013-10-22: Tulip 0.1.1
=======================
* First release.
Creation of the project
=======================
* 2013-10-14: The tulip package was renamed to asyncio.
* 2012-10-16: Creation of the Tulip project, started as mail threads on the
python-ideas mailing list.