Skip to content

Fix some issues with Ignitor #15276

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

Merged
merged 1 commit into from
Oct 23, 2019
Merged

Conversation

pranavkm
Copy link
Contributor

  • Avoid null ref when FormatException is not set
  • Handle errors when the client is canceled but an operation is in progress

* Avoid null ref when FormatException is not set
* Handle errors when the client is canceled but an operation is in progress
namespace Ignitor
{
internal class CancellableOperation<TResult>
{
public CancellableOperation(TimeSpan? timeout)
public CancellableOperation(TimeSpan? timeout, CancellationToken cancellationToken)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bulk of the interesting changes are localized to this type. Here's what happens:

  1. We start a PrepareForNextBatch
  2. In the meanwhile, BlazorClient.Cancel is invoked (the server may or may not be dead at this point)
  3. CancellableOperation knows nothing about this and eventually times out.

This change associates the BlazorClient.Cancel with the operation and no-ops if the client has been cancelled

@@ -233,7 +236,7 @@ private async Task<CapturedRenderBatch> WaitForRenderBatch(TimeSpan? timeout = n
{
return await PrepareForNextBatch(timeout ?? DefaultOperationTimeout);
}
catch (OperationCanceledException)
catch (TimeoutException) when (FormatError != null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a pain to discover: FomatError isn't set up in the benchmarks repo. Took me forever to figure out was causing a null ref.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pranavkm What is format error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pilchie Pilchie added the area-blazor Includes: Blazor, Razor Components label Oct 23, 2019
Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvements!

@pranavkm pranavkm merged commit 9f9fbd0 into release/3.1 Oct 23, 2019
@pranavkm pranavkm deleted the prkrishn/more-extensive-ignitor branch October 23, 2019 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants