* Don't preserve the ExecutionContext when dispatching callbacks
- The layers up stack already preserve and restore the ExecutionContext, there's no need to capture and run for the scheduler callback and cancellation token callback
- Avoid race where a connection reset observed by both DoSend() and DoReceive()
resulted in a ConnectionAbortedException being thrown from the input Pipe
instead of a ConnectionResetException.
This change makes the handling of graceful shutdown work for more than just http scenarios. This should allow us to move TLS further out and should also allow us to start moving things to connection middleware instead of connection adapters.
Summary of the things changed/added:
- Added IConnectionLifetimeNotificationFeature that represents an attempt to gracefully close the connection that isn't being aborted. This feels pretty awful but we may have to do it.
- Moved connection management to the ConnectionDispatcher and out of the HttpConnectionMiddleware
- Removed Http from the names of the ConnectionManager and Heartbeat
- Include hosting logs in some tests that where previously missing them
- Prevent duplicate logs from Mock CallBase an CompositeKestrelTrace
- Log ports used by transport functional tests
- Add file logging to HTTP/2 "unit" tests
This moves source code that used to be in aspnet/Common. It was only used here, so this simplifies the process of working with these internal-only APIs.
cref https://github.com/aspnet/Common/pull/386
* Decouple connection objects from the server (#2535)
- Making progress towards being able to use the connection objects on the client side.
* Wait for input writer to complete before calling OnConnectionClosed (#2566)
* Wait for the ConnectionClosed token to stop tracking connections (#2574)
- The prior strategy of waiting for the pipe completed callbacks doesn't work
because blocks are returned to the memory pool after the callbacks are fired.
* Consistently handle connection resets (#2547)
* Provide better connection abort exceptions and logs
* void IConnectionDispatcher.OnConnection