问题
I'm working on an application that used to share common files to blob storage (i.e. Worker Role A would update those files and Worker Role B would read those).
As this application is non critical we recently transitioned to Azure File Service share, even though it's still a preview.
It was working just fine until recently when a file lock wouldn't be released on the share, even after trying to delete all the instances that could possibly have a handle on those files. Always the same message when trying to remove of rename a file:
I remember having those kind of issues when using SMB, but then the solution would be to log to the share server and remove the locks... which we obviously can't do with azure file service.
Would you have an idea on how to release such locks?
回答1:
Thanks Charles for bringing this up. We looked at your example, and looks like we are being too conservative in closing the handles in certain rare circumstances.
We have made an improvement to detect this case and will be rolling this out soon.
For now we have mitigated on our end, so your share should have the locks deleted. Please let us know if you hit this issue again.
回答2:
I hit something like this today with an ISO image stored in an Azure File Share.
The ISO image had been mounted about 10-11 times within a remote session (in error). The mounts were removed, but once that had been done, we lost the ability to mount or copy the ISO, with either locking errors or more general errors, always after a long wait.
I was able to rename the file and access it's property sheet, but only after a long wait too.
Deleting the file did work.
来源:https://stackoverflow.com/questions/26171306/understanding-removing-a-file-lock-on-azure-file-service