Skip to content

Close persistent proxy clients in dependency order - #63

Merged
ioquatix merged 2 commits into
mainfrom
fix/proxy-client-lifecycle
Aug 25, 2026
Merged

Close persistent proxy clients in dependency order#63
ioquatix merged 2 commits into
mainfrom
fix/proxy-client-lifecycle

Conversation

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor

Summary

  • add a regression test using a real local HTTP server and CONNECT proxy
  • close cached clients in reverse insertion order so tunnelled clients close before the proxy clients they depend on

A CONNECT tunnel remains an active request on the proxy client until the tunnelled client closes. Client#close waits for active requests to drain, but PersistentClients inserted the proxy client before the tunnelled client and then closed in insertion order. That made shutdown wait on the CONNECT request before closing the client that could finish it.

This addresses the deterministic persistent-client shutdown deadlock isolated while investigating #59.

Verification

  • regression test fails on the first commit with Async::TimeoutError in Async::Pool::Controller#wait_until_free
  • bundle exec sus — 28 examples, 138 assertions
  • bundle exec rubocop lib/async/http/faraday/clients.rb test/async/http/faraday/clients.rb

@ioquatix
ioquatix merged commit 9ae3f99 into main Aug 25, 2026
34 of 40 checks passed
@ioquatix
ioquatix deleted the fix/proxy-client-lifecycle branch August 25, 2026 21:12
@ioquatix ioquatix added this to the v0.23.0 milestone Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants