Skip to content

Commit 053052d

Browse files
authored
Remove KestrelEventSource events with broken ActivityId tracking (#26684)
* Remove KestrelEventSource events with broken ActivityId tracking * Skip test requiring ALPN on macOS
1 parent 95b0518 commit 053052d

File tree

8 files changed

+459
-137
lines changed

8 files changed

+459
-137
lines changed

src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelEventSource.cs

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -144,54 +144,12 @@ public void ConnectionRejected(string connectionId)
144144
public void ConnectionQueuedStart(BaseConnectionContext connection)
145145
{
146146
Interlocked.Increment(ref _connectionQueueLength);
147-
if (IsEnabled())
148-
{
149-
ConnectionQueuedStart(
150-
connection.ConnectionId,
151-
connection.LocalEndPoint?.ToString(),
152-
connection.RemoteEndPoint?.ToString());
153-
}
154-
}
155-
156-
[MethodImpl(MethodImplOptions.NoInlining)]
157-
[Event(6, Level = EventLevel.Informational)]
158-
private void ConnectionQueuedStart(string connectionId,
159-
string localEndPoint,
160-
string remoteEndPoint)
161-
{
162-
WriteEvent(
163-
6,
164-
connectionId,
165-
localEndPoint,
166-
remoteEndPoint
167-
);
168147
}
169148

170149
[NonEvent]
171150
public void ConnectionQueuedStop(BaseConnectionContext connection)
172151
{
173152
Interlocked.Decrement(ref _connectionQueueLength);
174-
if (IsEnabled())
175-
{
176-
ConnectionQueuedStop(
177-
connection.ConnectionId,
178-
connection.LocalEndPoint?.ToString(),
179-
connection.RemoteEndPoint?.ToString());
180-
}
181-
}
182-
183-
[MethodImpl(MethodImplOptions.NoInlining)]
184-
[Event(7, Level = EventLevel.Informational)]
185-
private void ConnectionQueuedStop(string connectionId,
186-
string localEndPoint,
187-
string remoteEndPoint)
188-
{
189-
WriteEvent(
190-
7,
191-
connectionId,
192-
localEndPoint,
193-
remoteEndPoint
194-
);
195153
}
196154

197155
[NonEvent]
@@ -245,70 +203,24 @@ public void TlsHandshakeFailed(string connectionId)
245203
public void RequestQueuedStart(HttpProtocol httpProtocol, string httpVersion)
246204
{
247205
Interlocked.Increment(ref _httpRequestQueueLength);
248-
// avoid allocating the trace identifier unless logging is enabled
249-
if (IsEnabled())
250-
{
251-
RequestQueuedStart(httpProtocol.ConnectionIdFeature, httpProtocol.TraceIdentifier, httpVersion);
252-
}
253-
}
254-
255-
[MethodImpl(MethodImplOptions.NoInlining)]
256-
[Event(11, Level = EventLevel.Informational)]
257-
private void RequestQueuedStart(string connectionId, string requestId, string httpVersion)
258-
{
259-
WriteEvent(11, connectionId, requestId, httpVersion);
260206
}
261207

262208
[NonEvent]
263209
public void RequestQueuedStop(HttpProtocol httpProtocol, string httpVersion)
264210
{
265211
Interlocked.Decrement(ref _httpRequestQueueLength);
266-
// avoid allocating the trace identifier unless logging is enabled
267-
if (IsEnabled())
268-
{
269-
RequestQueuedStop(httpProtocol.ConnectionIdFeature, httpProtocol.TraceIdentifier, httpVersion);
270-
}
271-
}
272-
273-
[MethodImpl(MethodImplOptions.NoInlining)]
274-
[Event(12, Level = EventLevel.Informational)]
275-
private void RequestQueuedStop(string connectionId, string requestId, string httpVersion)
276-
{
277-
WriteEvent(12, connectionId, requestId, httpVersion);
278212
}
279213

280214
[NonEvent]
281215
public void RequestUpgradedStart(HttpProtocol httpProtocol)
282216
{
283217
Interlocked.Increment(ref _currentUpgradedHttpRequests);
284-
if (IsEnabled())
285-
{
286-
RequestUpgradedStart(httpProtocol.ConnectionIdFeature, httpProtocol.TraceIdentifier, httpProtocol.HttpVersion, httpProtocol.Path, httpProtocol.MethodText);
287-
}
288-
}
289-
290-
[MethodImpl(MethodImplOptions.NoInlining)]
291-
[Event(13, Level = EventLevel.Informational)]
292-
private void RequestUpgradedStart(string connectionId, string requestId, string httpVersion, string path, string method)
293-
{
294-
WriteEvent(13, connectionId, requestId, httpVersion, path, method);
295218
}
296219

297220
[NonEvent]
298221
public void RequestUpgradedStop(HttpProtocol httpProtocol)
299222
{
300223
Interlocked.Decrement(ref _currentUpgradedHttpRequests);
301-
if (IsEnabled())
302-
{
303-
RequestUpgradedStop(httpProtocol.ConnectionIdFeature, httpProtocol.TraceIdentifier, httpProtocol.HttpVersion, httpProtocol.Path, httpProtocol.MethodText);
304-
}
305-
}
306-
307-
[MethodImpl(MethodImplOptions.NoInlining)]
308-
[Event(14, Level = EventLevel.Informational)]
309-
private void RequestUpgradedStop(string connectionId, string requestId, string httpVersion, string path, string method)
310-
{
311-
WriteEvent(14, connectionId, requestId, httpVersion, path, method);
312224
}
313225

314226
protected override void OnEventCommand(EventCommandEventArgs command)

src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public HandshakeTests()
3636

3737
[ConditionalFact]
3838
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.Windows)]
39-
// Mac SslStream is missing ALPN support: https://github.com/dotnet/corefx/issues/30492
39+
// Mac SslStream is missing ALPN support: https://github.com/dotnet/runtime/issues/27727
4040
public void TlsAndHttp2NotSupportedOnMac()
4141
{
4242
var ex = Assert.Throws<NotSupportedException>(() => new TestServer(context =>
@@ -79,7 +79,7 @@ public void TlsAndHttp2NotSupportedOnWin7()
7979
}
8080

8181
[ConditionalFact]
82-
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")]
82+
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/runtime/issues/27727")]
8383
[MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)]
8484
public async Task TlsAlpnHandshakeSelectsHttp2From1and2()
8585
{
@@ -107,7 +107,7 @@ public async Task TlsAlpnHandshakeSelectsHttp2From1and2()
107107
}
108108

109109
[ConditionalFact]
110-
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")]
110+
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/runtime/issues/27727")]
111111
[MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)]
112112
public async Task TlsAlpnHandshakeSelectsHttp2()
113113
{

src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2
2323
{
24-
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")]
24+
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/runtime/issues/27727")]
2525
[MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)]
2626
public class ShutdownTests : TestApplicationErrorLoggerLoggedTest
2727
{

0 commit comments

Comments
 (0)