You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Difficult to reproduce without a slow filesystem) As soon as you open a FileStream, the file exists. However, that doesn't mean it contains anything. Since the IIS vs managed decision is made based on the existence of the file, and since (based on my tests) IIS does not block to wait for file read access (it ignores open handles, and reads the file anyway - or, sometimes with some network shares, fails immediately with an exception), you will get corrupt data or an 500.
(Should be easier to reproduce) When two requests for the same resource arrive at similar times (during the remote download), the last file to download will fail with a file access error.
A way to mitigate both issues is to download to a random temporary file, then move the complete file to the final location. If the move fails, you assume the download completed on another thread and delete the temp file.
The text was updated successfully, but these errors were encountered:
A way to mitigate both issues is to download to a random temporary file, then move the complete file to the final location. If the move fails, you assume the download completed on another thread and delete the temp file.
The text was updated successfully, but these errors were encountered: