feat: add per-connection attachment storage to HttpConnectionInternal - #6235
Open
Harshal96 wants to merge 4 commits into
Open
feat: add per-connection attachment storage to HttpConnectionInternal#6235Harshal96 wants to merge 4 commits into
Harshal96 wants to merge 4 commits into
Conversation
Contributor
Author
|
@vietj something like this? |
vietj
reviewed
Jul 9, 2026
vietj
reviewed
Jul 9, 2026
vietj
requested changes
Jul 9, 2026
vietj
reviewed
Jul 15, 2026
vietj
reviewed
Jul 15, 2026
vietj
requested changes
Jul 15, 2026
Member
|
ping @Harshal96 |
vietj
force-pushed
the
http-connection-local-storage
branch
from
July 27, 2026 10:13
5a4d59b to
38ba1f3
Compare
vietj
requested changes
Jul 27, 2026
vietj
left a comment
Member
There was a problem hiding this comment.
Can you instead of using a map with synchronization around instead use a ConcurrentHashMap implementation ?
Contributor
Author
|
@vietj done |
vietj
force-pushed
the
http-connection-local-storage
branch
from
July 28, 2026 09:39
743f6e6 to
73c8713
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
vert-x3/vertx-web#2910 needs per-connection state (announced Alt-Svc origins) scoped to the connection's lifecycle. The current workaround in vertx-web is a
WeakHashMap<HttpConnection, T>, which can't reliably clean up stale connections (see discussion in that PR).Changes
New
HttpConnectionInternalinterface inio.vertx.core.internal.http, following the existingHttpServerRequestInternal/HttpClientRequestInternalpattern:Backed by a lazily-created map stored directly on the connection object (not an external map keyed by connection), so entries are naturally scoped to the connection's own lifecycle — no leak risk, no weak references needed.
Wired into all four connection implementations:
ConnectionBase (shared by Http1Connection, Http2ConnectionImpl, Http2MultiplexConnection), cleared in handleClosed(). Http3Connection, which doesn't extend ConnectionBase, gets its own field and clears it in its own handleClosed().
Fixes #6234