Skip to content

Commit

Permalink
Remove KestrelEventSource events with broken ActivityId tracking (dot…
Browse files Browse the repository at this point in the history
…net#26684)

* Remove KestrelEventSource events with broken ActivityId tracking

* Skip test requiring ALPN on macOS
  • Loading branch information
halter73 authored Oct 8, 2020
1 parent 95b0518 commit 053052d
Show file tree
Hide file tree
Showing 8 changed files with 459 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,54 +144,12 @@ public void ConnectionRejected(string connectionId)
public void ConnectionQueuedStart(BaseConnectionContext connection)
{
Interlocked.Increment(ref _connectionQueueLength);
if (IsEnabled())
{
ConnectionQueuedStart(
connection.ConnectionId,
connection.LocalEndPoint?.ToString(),
connection.RemoteEndPoint?.ToString());
}
}

[MethodImpl(MethodImplOptions.NoInlining)]
[Event(6, Level = EventLevel.Informational)]
private void ConnectionQueuedStart(string connectionId,
string localEndPoint,
string remoteEndPoint)
{
WriteEvent(
6,
connectionId,
localEndPoint,
remoteEndPoint
);
}

[NonEvent]
public void ConnectionQueuedStop(BaseConnectionContext connection)
{
Interlocked.Decrement(ref _connectionQueueLength);
if (IsEnabled())
{
ConnectionQueuedStop(
connection.ConnectionId,
connection.LocalEndPoint?.ToString(),
connection.RemoteEndPoint?.ToString());
}
}

[MethodImpl(MethodImplOptions.NoInlining)]
[Event(7, Level = EventLevel.Informational)]
private void ConnectionQueuedStop(string connectionId,
string localEndPoint,
string remoteEndPoint)
{
WriteEvent(
7,
connectionId,
localEndPoint,
remoteEndPoint
);
}

[NonEvent]
Expand Down Expand Up @@ -245,70 +203,24 @@ public void TlsHandshakeFailed(string connectionId)
public void RequestQueuedStart(HttpProtocol httpProtocol, string httpVersion)
{
Interlocked.Increment(ref _httpRequestQueueLength);
// avoid allocating the trace identifier unless logging is enabled
if (IsEnabled())
{
RequestQueuedStart(httpProtocol.ConnectionIdFeature, httpProtocol.TraceIdentifier, httpVersion);
}
}

[MethodImpl(MethodImplOptions.NoInlining)]
[Event(11, Level = EventLevel.Informational)]
private void RequestQueuedStart(string connectionId, string requestId, string httpVersion)
{
WriteEvent(11, connectionId, requestId, httpVersion);
}

[NonEvent]
public void RequestQueuedStop(HttpProtocol httpProtocol, string httpVersion)
{
Interlocked.Decrement(ref _httpRequestQueueLength);
// avoid allocating the trace identifier unless logging is enabled
if (IsEnabled())
{
RequestQueuedStop(httpProtocol.ConnectionIdFeature, httpProtocol.TraceIdentifier, httpVersion);
}
}

[MethodImpl(MethodImplOptions.NoInlining)]
[Event(12, Level = EventLevel.Informational)]
private void RequestQueuedStop(string connectionId, string requestId, string httpVersion)
{
WriteEvent(12, connectionId, requestId, httpVersion);
}

[NonEvent]
public void RequestUpgradedStart(HttpProtocol httpProtocol)
{
Interlocked.Increment(ref _currentUpgradedHttpRequests);
if (IsEnabled())
{
RequestUpgradedStart(httpProtocol.ConnectionIdFeature, httpProtocol.TraceIdentifier, httpProtocol.HttpVersion, httpProtocol.Path, httpProtocol.MethodText);
}
}

[MethodImpl(MethodImplOptions.NoInlining)]
[Event(13, Level = EventLevel.Informational)]
private void RequestUpgradedStart(string connectionId, string requestId, string httpVersion, string path, string method)
{
WriteEvent(13, connectionId, requestId, httpVersion, path, method);
}

[NonEvent]
public void RequestUpgradedStop(HttpProtocol httpProtocol)
{
Interlocked.Decrement(ref _currentUpgradedHttpRequests);
if (IsEnabled())
{
RequestUpgradedStop(httpProtocol.ConnectionIdFeature, httpProtocol.TraceIdentifier, httpProtocol.HttpVersion, httpProtocol.Path, httpProtocol.MethodText);
}
}

[MethodImpl(MethodImplOptions.NoInlining)]
[Event(14, Level = EventLevel.Informational)]
private void RequestUpgradedStop(string connectionId, string requestId, string httpVersion, string path, string method)
{
WriteEvent(14, connectionId, requestId, httpVersion, path, method);
}

protected override void OnEventCommand(EventCommandEventArgs command)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public HandshakeTests()

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

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

[ConditionalFact]
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")]
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/runtime/issues/27727")]
[MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)]
public async Task TlsAlpnHandshakeSelectsHttp2()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2
{
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")]
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/runtime/issues/27727")]
[MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)]
public class ShutdownTests : TestApplicationErrorLoggerLoggedTest
{
Expand Down
Loading

0 comments on commit 053052d

Please sign in to comment.