This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[release/3.1] [coreclr] Fix FileStream.Dispose silently fails on Dispose when disk has run out of space #28099
Merged
carlossanlop
merged 1 commit into
dotnet:release/3.1
from
carlossanlop:FileStreamDispose
Sep 22, 2020
Merged
[release/3.1] [coreclr] Fix FileStream.Dispose silently fails on Dispose when disk has run out of space #28099
carlossanlop
merged 1 commit into
dotnet:release/3.1
from
carlossanlop:FileStreamDispose
Sep 22, 2020
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…isk has run out of space
@dotnet/dnceng can you please help with the Helix internal server error 500's here? |
Taking a quick peek, likely fallout from flipping over to the new Helix API earlier. |
@danmosemsft filed https://github.com/dotnet/core-eng/issues/10854 and flipped the API back to the old one; we'll take another swing at keeping the old APIs working next week. |
thanks. let's try again |
jozkee
approved these changes
Sep 18, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, given that it is a direct port.
The unit test failure is unrelated to my changes: System.Text.RegularExpressions
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backporting PR dotnet/runtime#38742
The test goes into corefx: dotnet/corefx#42988
Fixes: dotnet/runtime#42360
Customer Impact
A customer hit this issue in 3.1 when trying to deploy to AzureStorage: dotnet/runtime#42360
On Unix, when the disk runs out of space before a
FileStream
is disposed and the buffer is flushed to disk,Dispose
silently succeeds, causing files to be corrupted and preventing the user from taking corrective action.On Windows, we throw at the expected moment, allowing the user to react appropriately.
The suggested fix is to save any error thrown when the
SafeFileHandle.ReleaseHandle
method is called when the handle is disposed, then check that saved error inFileStream.Dispose
, and throw an exception if there was an error.The customer who reported this issue stated they will not be able to migrate to 5.0 soon.
Testing
Risk
Low.
This is a straight port of code already proven in 5.0. The code is simply doing an additional check that will ensure an exception is thrown so the user can be notified of failure.