Skip to content

fix AcceptHttp being rebuilt for every connection#700

Merged
olix0r merged 1 commit intover/accept-profiles-tcp-splitfrom
eliza/dont-clone-detect
Oct 9, 2020
Merged

fix AcceptHttp being rebuilt for every connection#700
olix0r merged 1 commit intover/accept-profiles-tcp-splitfrom
eliza/dont-clone-detect

Conversation

@hawkw
Copy link
Contributor

@hawkw hawkw commented Oct 9, 2020

The AcceptHttp service is stateful. It builds the underlying HTTP,
HTTP/2, and TCP service stacks lazily the first time they're needed.
This interacts badly with the derived implementation of Clone: if it's
cloned before the state is set, the state will only be set for the
clone, rather than for the original instance in the cache. Since
Prefix clones and oneshots the underlying service (AcceptHttp), this
means that we rebuild the HTTP, HTTP/2, and TCP stacks on every
connection to the same orig dest. This basically breaks caching for
everything other than service profile discovery, causing us to do new
destination discovery for every connection to the same original
destination. Which...isn't great.

This branch fixes this issue by removing the Clone impl from
AcceptHttp and putting it behind a buffer instead. In the future, it
may be possible to fix this in a nicer way, but this resolves the issue
for now.

@hawkw hawkw requested review from a team and olix0r October 9, 2020 18:59
@olix0r olix0r merged commit 435d881 into ver/accept-profiles-tcp-split Oct 9, 2020
@olix0r olix0r deleted the eliza/dont-clone-detect branch October 9, 2020 19:01
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