Skip to content

Commit ce15dc7

Browse files
authored
Fix UnobservedTaskException on Http2's SendPingAsync (#64494)
Wrap the SendPingAsync function with LogExceptions in Http2Connection.cs to avoid any exception here being caught as an UnobservedTaskException. Fix #64450 Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
1 parent c12bea8 commit ce15dc7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ private void VerifyKeepAlive()
20382038
_keepAlivePingTimeoutTimestamp = now + _keepAlivePingTimeout;
20392039

20402040
long pingPayload = Interlocked.Increment(ref _keepAlivePingPayload);
2041-
SendPingAsync(pingPayload);
2041+
LogExceptions(SendPingAsync(pingPayload));
20422042
return;
20432043
}
20442044
break;

0 commit comments

Comments
 (0)