-
Notifications
You must be signed in to change notification settings - Fork 524
Add IHttpConnectionFeature.ConnectionId. #638
Conversation
@@ -194,18 +192,18 @@ private void OnRead(UvStreamHandle handle, int status) | |||
|
|||
private Frame CreateFrame() | |||
{ | |||
return FrameFactory(this, _remoteEndPoint, _localEndPoint, _filterContext?.PrepareRequest); | |||
return FrameFactory(this); |
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.
👍
1ea16f9
to
a97f6b3
Compare
Updated |
|
public Connection(ListenerContext context, UvStreamHandle socket) : base(context) | ||
{ | ||
_socket = socket; | ||
ConnectionControl = this; | ||
|
||
_connectionId = Interlocked.Increment(ref _lastConnectionId); | ||
ConnectionId = Interlocked.Increment(ref _lastConnectionId).ToString(CultureInfo.InvariantCulture); |
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.
Not performant enough. Take a look at what we did with request id and copy it.
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.
As this is a property could it be lazy-init? Though might not work with the logging; as will currently always init.
Logging could be passed a ConnectionContext
rather than ConnectionId
and if enabled at that level then call ConnectionId
which inits the value.
Task.Id
in coreclr uses this approach dotnet/coreclr#3139
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.
Keep in mind that this is once per connection, not per request. I think Frame's copy constructor would always resolve it anyways.
a97f6b3
to
f1e1d3a
Compare
Updated |
f1e1d3a
to
1495745
Compare
1495745
to
aef612b
Compare
Depends on aspnet/HttpAbstractions#564
@halter73
Most of the noise is that I changed the existing connectionId from long to string. I also cleaned up FrameFactory.