Skip to content

Conversation

@jswanner
Copy link
Contributor

@jswanner jswanner commented Oct 23, 2025

HTTP2 connections will unregister themselves from the pool once enter connected_read_only and disconnected states, and register themselves on init or after they reconnect.

Fixes #216, replaces #227.

HTTP2 connections will unregister themselves from the pool once enter
connected_read_only and disconnected states, and register themselves on init
or after they reconnect.

Fixes sneako#216
Comment on lines +349 to +355
def connected(:enter, _old_state, data) do
{:ok, _} =
Registry.register(data.finch_name, {data.scheme, data.host, data.port}, __MODULE__)

{:keep_state, put_in(data.registered, true)}
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't only have the pool register itself when the connection enter :connected state, as HTTP2.PoolMetrics tests failed because instead of having multiple requests sent over a single HTTP/2 connection, individual HTTP/2 connections were created for each request.

Registering the pool in c:init/1 and then here after a reconnection fixed the tests.

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.

Discussion: should HTTP/2 pool skip over not ready connections?

2 participants