-
Notifications
You must be signed in to change notification settings - Fork 134
Description
Currently we only clear the idle read timer, if we receive an http .end.
async-http-client/Sources/AsyncHTTPClient/ConnectionPool/HTTP1.1/HTTP1ClientChannelHandler.swift
Line 468 in a0b0985
| return .clearIdleReadTimeoutTimer |
However if the request is cancelled or the connection fails, we may never receive such an event. For this reason we should ensure in
async-http-client/Sources/AsyncHTTPClient/ConnectionPool/HTTP1.1/HTTP1ClientChannelHandler.swift
Lines 34 to 35 in a0b0985
| private var request: HTTPExecutableRequest? { | |
| didSet { |
with a willSet method that a running idleReadTimeoutTimer is cancelled. Currently we may run into a precondition if:
Currently we should run into a precondition, if the following happens:
- On an HTTPClient that has idleTimeout enabled a request is sent
- The remote server waits to receive the full request and closes the connection without sending a response
- The HTTPClient and its ELG must be kept alive for at least the idleTimeout duration
We should run into the precondition here:
async-http-client/Sources/AsyncHTTPClient/ConnectionPool/HTTP1.1/HTTP1ConnectionStateMachine.swift
Line 311 in a0b0985
| preconditionFailure("Invalid state: \(self.state)") |