wimh/SparkleShare — Issue #25: Crash on copying large directory to repo
Author: lhugsereg
Created: 2012-01-07 16:27:27+00:00
State: open

Test case:
--------------------
Windows client, W7 32bit

1. Connect to privately hosted GIT repo with private notification server
2. Copy following directories to SparkleShare folder using Windows Explorer:
- TestCase1 (containing 500 text files)
- subfolder1 (containing 500 text files)
- subfolder2 (containing 500 text files)

Consequence:
--------------------
SparkleShare crash, exception IOException with following stack trace (sorry for german words, "bei" means at; rest should be self-explanatory)

Unhandled exeption: System.IO.IOException: Process cannot access "C:\Users\florian\Documents\SparkleShare\test\TestCase1" because it is used by another process.
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs,
SearchOption searchOption)
bei System.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption)
bei System.IO.Directory.GetDirectories(String path)
bei SparkleLib.SparkleRepoGit.FillEmptyDirectories(String path)
bei SparkleLib.SparkleRepoGit.FillEmptyDirectories(String path)
bei SparkleLib.SparkleRepoGit.get_AnyDifferences()
bei SparkleLib.SparkleRepoBase.OnFileActivity(FileSystemEventArgs args)
bei SparkleLib.SparkleRepoBase.b__8(FileSystemEventArgs args)
bei SparkleLib.SparkleWatcher.<.ctor>b__1(Object o, FileSystemEventArgs args)
bei System.IO.FileSystemWatcher.OnCreated(FileSystemEventArgs e)
bei System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(Int32 action, String name)
bei System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
bei System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Somehow Windows Explorer seems to lock the TestCase1 folder while copying making it unwritable for other processes. For now, I just put a "try... catch" block at the affected code to continue testing, but a proper fix by someone who knows the code would be cool.