[6.0] Remove IsAvailable check on CommitAsync. #44610
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport #43059 to 6.0
Remove IsAvailable check on CommitAsync.
This removes an unnecessary call to
IsAvailable
inCommitAsync
that was added during a large change that added nullability annotations in a bunch of places.Fixes #42009
Customer Impact
In addition to being unnecessary, the
IsAvailable
call can cause a significant performance hit to the application since it will try to load the session each time onCommitAsync
whether or not it needs to.We've had multiple folks run into this issue and report it. For instance, see #43059 (comment) where someone was using a setup recommended in our official docs for distributed caching and observed a massive CPU usage hit on their servers caused by this issue.
Regression?
The issue was introduced in 6.0 (#26098)
Risk
Removes a superfluous check.
Verification
Packaging changes reviewed?