Skip to content
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

Warnings after updating to 2.2.0 #2613

Closed
marekott opened this issue Sep 23, 2024 · 4 comments
Closed

Warnings after updating to 2.2.0 #2613

marekott opened this issue Sep 23, 2024 · 4 comments
Labels
needs-author-action An issue or pull request that requires more info or actions from the author. Type: Bug Something isn't working

Comments

@marekott
Copy link
Contributor

marekott commented Sep 23, 2024

Describe the bug

After updating Yarp.ReverseProxy to 2.2.0 we have suddenly started observing a lot of warnings logged, for example:

UpgradeResponseCanceled: Copying the upgraded response body was canceled.
UpgradeResponseDestination: The destination reported an error when copying the upgraded response body.
RequestTimedOut: The request timed out before receiving a response.
Request: An error was encountered before receiving a response.
ResponseBodyCanceled: Copying the response body was canceled.

Such logs were never observed in 2.0.1 and downgrading to it, immediately stops them. I've already created similar issue when updating to 2.1.0: #2340. From mentioned there issues I've concluded that level of those warning was lowered to debug in 2.2.0. However they are logged as warnings.

I have two questions regarding above situation:

  1. Is it expected behavior that such logs are logged as warnings?
  2. Should I be concerned about those entries since their log level was raised in newer version of the package?
@marekott marekott added the Type: Bug Something isn't working label Sep 23, 2024
@marekott
Copy link
Contributor Author

Example stack trace:

"MessageTemplate": "{error}: {message}",
"RenderedMessage": "UpgradeResponseCanceled: Copying the upgraded response body was canceled.",
"Exception": "System.Threading.Tasks.TaskCanceledException: The operation was canceled.\n ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled.\n ---> System.Net.Sockets.SocketException (125): Operation canceled\n   --- End of inner exception stack trace ---\n   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)\n   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)\n   at System.Net.Http.HttpConnection.ReadAsync(Memory`1 destination)\n   at System.Net.Http.HttpConnection.RawConnectionStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)\n   --- End of inner exception stack trace ---\n   at System.Net.Http.HttpConnection.RawConnectionStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)\n   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)\n   at Yarp.ReverseProxy.Forwarder.StreamCopier.CopyAsync(Stream input, Stream output, Int64 promisedContentLength, StreamCopierTelemetry telemetry, ActivityCancellationTokenSource activityToken, Boolean autoFlush, CancellationToken cancellation)"

@marekott
Copy link
Contributor Author

Upon further investigation of changelog I see that only portion of exception levels were changed to debug (#2503).

So what about the ones that I've listed above?

@MihaZupan could you take a look at this?

@MihaZupan
Copy link
Member

As discussed in #2340, these aren't new warnings, but their log level has changed between versions.
That is, you would see these if you enabled Info-level logs even on 2.0.1.

The change in 2.2.0 moved several logs from Warning to Debug. From 2.2.0 preview 1 release notes:

  • Errors triggered by the client disconnecting are now logged under a Debug severity (Move request cancellations to a separate log #2503 by @MihaZupan).
    • ForwarderError.RequestCanceled, RequestBodyCanceled, and UpgradeRequestCanceled are now logged under a new ILogger event with a Debug severity. Other errors continue to be logged under the existing event with a Warning severity.
  • How errors are mapped to different ForwarderErrors remains the same.

The errors you listed weren't moved as they're not generally triggerable by the client, but potentially indicative of issues with the backend server.

@MihaZupan MihaZupan added the needs-author-action An issue or pull request that requires more info or actions from the author. label Sep 24, 2024
@marekott
Copy link
Contributor Author

Ok, thanks for clarification. I will investigate those logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-author-action An issue or pull request that requires more info or actions from the author. Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants