Skip to content

Generalize Http2Cat #17438

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

Merged
merged 14 commits into from
Dec 4, 2019
Merged

Generalize Http2Cat #17438

merged 14 commits into from
Dec 4, 2019

Conversation

Tratcher
Copy link
Member

@Tratcher Tratcher commented Nov 26, 2019

#14894 This is going to be fun.

We want to re-use Kestrel's low level Http2 test infrastructure to test HttpSys and other servers. Stephen already got it partially separated into a sample project, but that relied heavily on InternalsVisibleTo. This change takes the next step change from InternalsVisibleTo to shared src files. Moving content to the repo Shared folder gives us a clear separation of what's shared and why.

There are now three types of shared src:

  • Http2: Production code shared with corefx, Http2Cat, Kestrel, and HttpSys tests.
  • ServerInfrastructure: Production code shared with Http2Cat, Kestrel, and HttpSys tests.
  • Http2Cat: Test client specific code used by the Http2Cat sample and HttpSys tests.

There is one API that did need to become public: The client SocketConnectionFactory.

I've included two new HttpSys tests for the 3.1 GoAway feature. I even found a bug in the process #17420.

I did add some more OS version test infrastructure (dotnet/extensions#2715) that needs a dependency update, but that can happen later because the affected test is already skipped due to a product bug.

@Tratcher Tratcher added this to the 5.0.0-preview1 milestone Nov 26, 2019
@Tratcher Tratcher self-assigned this Nov 26, 2019
@Tratcher Tratcher added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Nov 26, 2019
@Tratcher Tratcher marked this pull request as ready for review November 26, 2019 23:59
@@ -26,3 +26,13 @@ public partial class SocketTransportOptions
public bool NoDelay { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
}
}
namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Client
{
public partial class SocketConnectionFactory : Microsoft.AspNetCore.Connections.IConnectionFactory, System.IAsyncDisposable
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with making this public in 5.0 for now, but is there any other option besides this? Does InternalsVisibleTo not work here?

Copy link
Member Author

Choose a reason for hiding this comment

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

InternalsVisibleTo isn't really an option when we need to consume this across several projects, it doesn't scale. Stephen said they wanted to make this public soon anyways.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know we wanted to improve this API to take in a propertybag/featurecollection. That may be something we want to consider before making this public?

Copy link
Member Author

Choose a reason for hiding this comment

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

We'll run it by API review Monday and see. If it's just additions then there's no need to block this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Scratch that, Servers aren't subject to API review yet. I'll check the current API with @halter73 and file any follow up issues. We have the entire release to work out the API surface and I want to get this in to unblock HttpSys feature development.

Copy link
Contributor

Choose a reason for hiding this comment

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

Given the namespace soup here (that it's deep within .Kestrel.Transport.Sockets.Client) I feel OK making this public since it won't collide with a more "real" client factory.

Copy link
Contributor

@jkotalik jkotalik left a comment

Choose a reason for hiding this comment

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

The lack of FrameWriter sharing is my biggest concern with this PR. Other than that, the separation seem correct.

@Tratcher Tratcher requested a review from jkotalik November 28, 2019 06:12
@Tratcher Tratcher removed the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Dec 2, 2019
Copy link
Contributor

@jkotalik jkotalik left a comment

Choose a reason for hiding this comment

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

Much better

@Tratcher Tratcher merged commit 3b7cdc1 into master Dec 4, 2019
@Tratcher Tratcher deleted the tratcher/h2cat branch December 4, 2019 00:16
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants