Fix for Documents Backend Hang



Hi,
   Ryan mentioned a hang in the documents backend a few days ago on IRC.  I couldn't reproduce it then but it has since shown up on my install as well.  Attached is a patch that should fix this problem.

   For those interested, it was a bug in vector-manager.cs that didn't release a mutex under certain error conditions.

Cheers,
Jim.
-- 
Jim McDonald - Jim mcdee net
diff -ruN clean/dashboard/index/vector-manager.cs dirty/dashboard/index/vector-manager.cs
--- clean/dashboard/index/vector-manager.cs	2003-12-09 11:54:57.000000000 +0000
+++ dirty/dashboard/index/vector-manager.cs	2003-12-19 19:38:36.000000000 +0000
@@ -119,12 +119,18 @@
 		mutex.WaitOne ();
 
 		if (index_fs == null)
+		{
+			mutex.ReleaseMutex();
 			return false;
+		}
 
 		byte [] buf = new byte [4];
 
 		if (index_fs.Read (buf, 0, buf.Length) <= 0)
+		{
+			mutex.ReleaseMutex();
 			return false;
+		}
 
 		int dim = BitConverter.ToInt32 (buf, 0);
 
@@ -133,7 +139,10 @@
 		int bytes_read = index_fs.Read (buf, 0, buf.Length);
 
 		if (bytes_read < 8*dim)
+		{
+			mutex.ReleaseMutex();
 			return false;
+		}
 
 		VectorNode node = new VectorNode ();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]