-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Implement new bedrock listener abstraction and re-plat Kestrel on top #10321
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
Conversation
| { | ||
| ValueTask<ConnectionContext> AcceptAsync(); | ||
|
|
||
| ValueTask DisposeAsync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the interface be bassed on IAsyncDisposable?
Same above in ConnectionContext.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I just hacked it because this is ns2.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh...thx.
src/Servers/Kestrel/Transport.Libuv/src/Internal/LibuvConnectionListener.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Transport.Libuv/src/Internal/LibuvConnectionListener.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Transport.Libuv/src/Internal/ListenerContext.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketConnection.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Transport.Sockets/src/SocketConnectionListener.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelConnection.cs
Show resolved
Hide resolved
| /// a new instance should be created using the same options. | ||
| /// </remarks> | ||
| public async Task DisposeAsync() | ||
| public override async ValueTask DisposeAsync() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
/azp run |
|
Pull request contains merge conflicts. |
|
AHHHHH |
- Added NoDelay to transport options - Added FileHandleEndPoint to represent listening to a file handle
- Moved feature implementations into KestrelConnection out of TransportConnection
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SignalR.Protocols.Json", "common\Protocols.Json\src\Microsoft.AspNetCore.SignalR.Protocols.Json.csproj", "{BB52C0FB-19FD-485A-9EBD-3FC173ECAEA0}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Metadata", "..\Http\Metadata\src\Microsoft.AspNetCore.Metadata.csproj", "{2E107FBB-2387-4A9F-A2CA-EFDF2E4DD64D}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're adding IAllowAnonymous and IAuthorizeData to the SignalR solution in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed it to compile, so pretend its ok. We added a new package but didn't add it to all the places. I had to make sure SignalR was working so I included this in the PR
src/Servers/Kestrel/Transport.Sockets/src/Internal/SocketConnection.cs
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
halter73
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending finding and fixing the root cause of the UvLoopHandle finalized. It would also be nice if you wrote "Primary"/"Secondary" to the accepted pipes in ListenerPrimaryTests and verified the response.
- Added ConfigureAwait(false) to DisposeAsync path - Added await using in tests to make sure threads are disposed - Remove more dead code
OK I spent a few hours on this and I'm still stumped and haven't been able to write a test to cause the condition to happen. I make a few tweaks to use await using in a couple of places just to make sure we're calling dispose in the right spots. What if we just add a log here so that we can know if this is a resource leak or a bad unit test? |
- Add a method to quickly run through each of the queued aborting all connections instead of using the IAsyncEnumerator.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Seems reasonable. We should probably log something anytime OnStopRude() let alone OnStopImmediate() is called. Maybe we could make those logs fail tests like the ungraceful shutdown log does. |
| /// </remarks> | ||
| public bool NoDelay { get; set; } = true; | ||
|
|
||
| public long? MaxReadBufferSize { get; set; } = PipeOptions.Default.PauseWriterThreshold; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: doc comments?
This is a massive set of changes to Kestrel to remove the existing pubternal transport layer and implement a public facing API for listeners and clients, see the details here #10308.
This change only has the server side pieces of the story as I don't want to add the client APIs without having ported SignalR to use them. Here are the highlights:
TransportConnectionhas been moved to Connection.Abstractions (we can decide if we need to consolidate withDefaultConnectionContextin a later PR)FileHandleEndPointwhich allows binding to a file handle (could be a pipe or tcp handle)EndPointinstance.Breaking Changes
ListenOptions, we should consider deprecating it. This has been moved to each of the transports. One major difference though is that it's no longer localized per endpoint but is global. We'd need a derivedEndPointtype (or maybe extendIPEndPoint) to store both the socket options and the binding information.@halter73 this is ready for review now.
Fixes #10308
Fixes #4752