Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable h2c traffic for http servers. #3890

Closed
wants to merge 5 commits into from

Conversation

a-feld
Copy link
Member

@a-feld a-feld commented Aug 25, 2021

Description: Added support for h2c traffic on http servers generated by confighttp.

This is in preparation for combining gRPC / HTTP ports for OTLP (see #3765 for the complete use case)

Testing: The HTTP receive tests have been updated to check for both http/1.1 and h2c traffic when "insecure" mode / non-TLS is used.

@a-feld a-feld requested a review from a team as a code owner August 25, 2021 14:46
@a-feld a-feld requested a review from owais August 25, 2021 14:46
@a-feld
Copy link
Member Author

a-feld commented Aug 25, 2021

@bogdandrutu @tigrannajaryan @jpkrohling Attempting to break down the gRPC/HTTP port combination work. This PR is a prerequisite to #3765 😄

Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

The code looks sane, but I would love to see a benchmark in the test suite to have an idea of what this change causes in terms of performance.

@a-feld
Copy link
Member Author

a-feld commented Aug 26, 2021

Good idea regarding the benchmark! 💡

Before:

goos: darwin
goarch: amd64
pkg: go.opentelemetry.io/collector/config/confighttp
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkHttpRequest-12    	  312465	      7150 ns/op	    4105 B/op	      45 allocs/op

After:

goos: darwin
goarch: amd64
pkg: go.opentelemetry.io/collector/config/confighttp
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkHttpRequest-12    	  311053	      7010 ns/op	    4121 B/op	      46 allocs/op

@a-feld
Copy link
Member Author

a-feld commented Aug 26, 2021

I also added a benchmark to verify that any performance delta would only be when using noTLS settings.

TLS traffic before and after should have no deltas.

Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2021

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 3, 2021
@bogdandrutu bogdandrutu removed the Stale label Sep 3, 2021
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 21, 2021
@bogdandrutu bogdandrutu removed the Stale label Sep 21, 2021
@a-feld a-feld force-pushed the enable-h2c branch 4 times, most recently from 1799a3b to e0069e3 Compare September 21, 2021 15:15
@mtwo
Copy link
Member

mtwo commented Sep 22, 2021

This needs to be merged before 9/24. @bogdandrutu will review.

Comment on lines 427 to 428
// Check that h2c payloads are handled when serving insecure traffic
if tt.tlsClientCreds.Insecure {
Copy link
Member

Choose a reason for hiding this comment

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

Consider to have this as a separate test only for this config. It is not recommended to add this and be run only for one of the "sub-tests".

Copy link
Member Author

Choose a reason for hiding this comment

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

@bogdandrutu done!

@a-feld
Copy link
Member Author

a-feld commented Sep 24, 2021

@bogdandrutu have you had a chance to review? I'll need to close this by end of day 9/24 (approximately 8 hours from now)

@a-feld a-feld closed this Sep 24, 2021
@alanwest
Copy link
Member

@bogdandrutu Looks like this PR was pretty close. I was not closely involved in this work, but I can get it reopened if it looks good to you.

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.

None yet

5 participants