dotnet/runtime

Ensure FileStatus' Unix exception throwing behavior matches Windows

Open

#31.141 geöffnet am 10. Okt. 2019

Auf GitHub ansehen
 (8 Kommentare) (9 Reaktionen) (0 zugewiesene Personen)C# (5.445 Forks)batch import
area-System.IObacklog-cleanup-candidatehelp wantedno-recent-activity

Repository-Metriken

Stars
 (17.886 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 12T 11h) (661 gemergte PRs in 30 T)

Beschreibung

Initially reported by @davidfowl and discussed via email with @JeremyKuhne : we need to make sure Unix matches Windows when it comes to capturing and throwing exceptions.

David got this callstack when the Docker container got disconnected:

Unhandled exception. Unhandled exception. System.IO.IOException: Input/output error
   at System.IO.FileStatus.EnsureStatInitialized(ReadOnlySpan`1 path, Boolean continueOnError)
   at System.IO.FileStatus.GetLastWriteTime(ReadOnlySpan`1 path, Boolean continueOnError)
   at Microsoft.Extensions.FileProviders.Physical.PollingFileChangeToken.GetLastWriteTimeUtc()
   at Microsoft.Extensions.FileProviders.Physical.PollingFileChangeToken.get_HasChanged()
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.RaiseChangeEvents(Object state)
   at System.Threading.TimerQueueTimer.CallCallback(Boolean isThreadPool)
   at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
   at System.Threading.TimerQueue.FireNextTimers()System.IO.IOException: Input/output error
   at System.IO.FileStatus.EnsureStatInitialized(ReadOnlySpan`1 path, Boolean continueOnError)
   at System.IO.FileStatus.GetLastWriteTime(ReadOnlySpan`1 path, Boolean continueOnError)
   at Microsoft.Extensions.FileProviders.Physical.PollingFileChangeToken.GetLastWriteTimeUtc()
   at Microsoft.Extensions.FileProviders.Physical.PollingFileChangeToken.get_HasChanged()
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.RaiseChangeEvents(Object state)
   at System.Threading.TimerQueueTimer.CallCallback(Boolean isThreadPool)
   at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Contributor Guide