Skip to content

Commit

Permalink
Resetting _waitForCompletion to null was removed from DuplexContent (#…
Browse files Browse the repository at this point in the history
…35010)

`_waitForCompletion` gets reset to null in `DuplexContent.Complete` and `Fail` which leads to race condition with `SerializeToStreamAsync`. This reset seems redundant since `_waitForCompletion` is always unconditionally initialized on each call to `SerializeToStreamAsync`. This PR removes that reset logic.

Fixes #33141
  • Loading branch information
alnikola authored Apr 17, 2020
1 parent 2e7dc5a commit 9fd1e23
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1937,13 +1937,11 @@ public Task<Stream> WaitForStreamAsync()
public void Complete()
{
_waitForCompletion.SetResult(true);
_waitForCompletion = null;
}

public void Fail(Exception e)
{
_waitForCompletion.SetException(e);
_waitForCompletion = null;
}
}

Expand Down

0 comments on commit 9fd1e23

Please sign in to comment.