0

Our processing platform contains a large number of machines where a large number of applications create files locally and copy them to an Isilon NAS. It also contains a single consumer, on a separate machine, reading these files from the Isilon NAS. Intermittently, 1 out of 50000, the consumer will throw an access violation stating the "file is locked by another application". The writes to the NAS successfully complete 100% of the time.

The only connection point between the writers and the NAS is the following call to File.Copy(localfile, "\\naslocation\destfilename"). If the consumer retries to read the file it is successful every time.

Is File.Copy not dependable? Meaning, after File.Copy returns to the caller the destination file may not be available to another process? Does Windows perform buffering when writing to a remote share causing a lag between the return of File.Copy and the file being detected as locked by a different application on a different machine?

Thanks in advance.

user481779
  • 1,071
  • 2
  • 14
  • 28
  • No. The writer notifies the consumer of the existence of the file only after File.Copy returns. – user481779 Jan 30 '13 at 19:06
  • More about how you are sending this notification. Please post code. I don't follow unlocked by a different application. – paparazzo Jan 30 '13 at 19:48
  • @Blam - I modified "being unlocked" to "being detected as locked" to make it clear. – user481779 Jan 30 '13 at 21:13
  • OK that is clear. Still how are you sending notification? – paparazzo Jan 30 '13 at 21:22
  • Using WCF to notify consumer. What are you getting at? Think it is significant? – user481779 Jan 30 '13 at 21:26
  • 1
    Wanted to be sure you are really notifying and not using a file watch. My only thought is write caching on the NAS causes File.Copy to be reported as done before it is really done. I would try a read on the source to see if you can get more failures. Then try turning off hardware caching (if it is indeed enabled). – paparazzo Jan 30 '13 at 21:41

0 Answers0