This reduces the need for functools.partial or lambda wrappers, and
works better with stack_context in some cases since binding the
arguments within IOLoop lets it see whether the function is already
wrapped.
Attempting to remove a non-existent fd raises IOError on epoll
but KeyError on kqueue; this change swallows any exeption to make
both platforms consistent.
This is one of two problems found with redbot. The other,
that etags should change when content-encoding is used, is trickier to
fix and seems to be less problematic.
Closes#578.
If the underlying socket was already closed the buffered data
would be passed to the final callback rather than the streaming callback.
Conflicts:
website/sphinx/releases/next.rst
Also add tests, and add get_auth_http_client method to all auth mixins.
Closes#634.
Conflicts:
tornado/test/auth_test.py
website/sphinx/releases/next.rst
The old_contexts reference in StackContexts could maintain a chain of
old irrelevant contexts, so clear it once it's no longer needed.
This was mainly a problem in gen.engine, where additional contexts
would accumulate in memory (but not on the stack) for each asynchronous
operation.
Also clear the deactivate_stack_context in gen.Runner to allow
the StackContext to be garbage-collected sooner.
The logging in read_from_fd is generally redundant with logging at
higher levels - the error would be logged again in _handle_read,
or propagated from _try_inline_read.
Closes#632.
This approach has more clearly defined precedence rules than the
previous insertion-time strategy implemented in add_handlers().
It also correctly leaves pattern matching in the hands of the regular
expression evaluator as opposed to directly comparing pattern strings.
SimpleAsyncHTTPClient now sends the first and last lines to the callback,
matching CurlAsyncHTTPClient's behavior.
All secondary callbacks are now wrapped for stack_context.
Closes#637.
The old_contexts reference in StackContexts could maintain a chain of
old irrelevant contexts, so clear it once it's no longer needed.
This was mainly a problem in gen.engine, where additional contexts
would accumulate in memory (but not on the stack) for each asynchronous
operation.
Also clear the deactivate_stack_context in gen.Runner to allow
the StackContext to be garbage-collected sooner.
Code that uses the global IOLoop may retain a global reference to
an AsyncHTTPClient as well, which would become inoperable after a test
had closed it.
If a user currently passes in 0ms (hopefully by accident) as the
callback time for a periodic callback, Tornado consumes a huge amount
of CPU and never calls the function.