Skip to content

Comments

Fix HttpTransformer-related issues#2016

Merged
MihaZupan merged 4 commits intodotnet:mainfrom
MihaZupan:transformer-cancellation
Jan 31, 2023
Merged

Fix HttpTransformer-related issues#2016
MihaZupan merged 4 commits intodotnet:mainfrom
MihaZupan:transformer-cancellation

Conversation

@MihaZupan
Copy link
Member

@MihaZupan MihaZupan commented Jan 30, 2023

This PR does a few things:

  • Marks HttpTransformer overloads without the CancellationToken as obsolete.
  • Makes sure all scenarios work as expected with the built-in StructuredTransformer (you can call overloads with or without the CT and it'll work).
  • Makes sure HttpForwarder always calls the overloads with the cancellation token.
  • Moves request transform calls into the try/catch block with HttpClient.SendAsync so that any failures are reported in a similar manner. Also added ForwarderError.RequestCreation in case the exception is not related to cancellation.
  • Switched the error reported if the manual CT is signaled to RequestCanceled (was RequestTimedOut).
  • Added a bunch of tests for the above.

@MihaZupan MihaZupan added this to the YARP 2.0.0 milestone Jan 30, 2023
@MihaZupan MihaZupan self-assigned this Jan 30, 2023
@MihaZupan MihaZupan requested a review from Tratcher as a code owner January 30, 2023 22:27
@MihaZupan MihaZupan merged commit 79a7b80 into dotnet:main Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants