1_9_1.md

doc/release_notes/1_9_1.md

1.9.1

Improvements

  • :connect_timeout will be split across the IP addresses available for the hostname. The connection phase will then loop on the list, and on each connect timeout, the next IP will tried; the connect timeout error will then only be raised if no healthy connections could be established to any of the IPs. This is the same heuristic used by curl v7.

  • Connections and parsers share the same pending requests queue: before, each had their own, and requests could fly across them depending on the several edge cases, thereby making it needlessly complex and wasteful. Also, when moving requests is necessary, they can short-circuit more efficiently.

  • Handled quoted charset property when parsing the “content-type” header in the response.

  • http1: Support peer server keep alive timeout (exposed via a response header like “Keep-Alive: timeout=10”), which overrides the client (or the default) :keep_alive_timeout setting.

  • http2: during the consumption loop, handle more pending requests when the window allows it.

  • several improvements on connection read/write consumption handling which save a few socket read/write syscalls.

Bugfixes

  • fix the json decoding integration with oj, which was using the Oj.load function in an unsafe manner, which oj documents. It now uses the :strict mode by default.

  • when doing Happy Eyeballs v2, do not accidentally coalesce sibling connections.

  • on session termination, ensure that idle connections are closed, something which may happen when an alt-svc response header creates a new connection, but no subsequent requests are sent its way.

  • fix race condition when terminating a selector, where its connections were checked on its state after termination; because terminated connections get checked back into the pool, they may be checked out before the state check happens. This fixes it by checking its current selector against itself.

  • ensure that the selector only calls the error handling once for the same connection.

  • request timeouts are now only set when the parser accepts them, and guaranteed only once.

  • when an operation timeout occurs, do not raise it on connections for which one wasn’t set.

  • native resolver: fix DNS query retry handling due to a confusion about using Enumerable.first and Enumerable.find, and the former silently ignoring passed blocks.

  • native resolver: discard received answers for DNS queries which have since been dropped due to a timeout.

  • native resolver: try out the next nameserver in case the prior was unreachable.

  • http-2: keep processing unfinished streams when receiving a GOAWAY with a last stream id pointing to streams that haven’t been finished.

  • faraday adapter: always load the OnData plugin, as a streaming request (which uses the .on_data Faraday API) may be preceded by a non-streaming request to fetch metadata (a pattern observed when using the google cloud storage ruby SDK).

  • ntml and ntlmv2 plugins: when used to send multiple requests, should return an array of responses.

  • oauth plugin: fix wrong method call.

  • cache plugin: skip cache flow for error responses.

  • proxy plugin: make the class used for the CONNECT proxy request inherit all functionality from other loaded plugins.

  • fiber_concurrency: fixed some corner cases where the connection could loop indefinitely or become corrupt.

  • tracing: fixing request start time bookkeeping.