[Mono-bugs] [Bug 73357][Blo] New - A stop from mod_mono is aborting mod-mono-server prematurely.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 4 Mar 2005 14:03:01 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by rlyon@novell.com.

http://bugzilla.ximian.com/show_bug.cgi?id=73357

--- shadow/73357	2005-03-04 14:03:01.000000000 -0500
+++ shadow/73357.tmp.12925	2005-03-04 14:03:01.000000000 -0500
@@ -0,0 +1,57 @@
+Bug#: 73357
+Product: Mono: Tools
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: XSP
+AssignedTo: gonzalo@ximian.com                            
+ReportedBy: rlyon@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: A stop from mod_mono is aborting mod-mono-server prematurely.
+
+A stop from mod_mono is aborting mod-mono-server prematurely.  The stop 
+in mod-mono-server is calling an abort on the same thread that the stop 
+is doing its work.  This is causing application clean-up to not happen.
+
+Here is a possible fix:
+
+Index: server/ApplicationServer.cs
+===================================================================
+--- server/ApplicationServer.cs	(revision 41374)
++++ server/ApplicationServer.cs	(working copy)
+@@ -274,10 +274,19 @@
+ 			if (!started)
+ 				throw new InvalidOperationException ("The 
+server is not started.");
+ 
++			Thread worker = new Thread(new ThreadStart 
+(StopThread));
++			worker.IsBackground = false;
++			worker.Start ();
++		}
++
++		void StopThread()
++		{
+ 			stop = true;	
+ 			runner.Abort ();
+ 			listen_socket.Close ();
+ 			UnloadAll ();
++
++			Thread.Sleep(TimeSpan.FromSeconds(1));
+ 			WebTrace.WriteLine ("Server stopped.");
+ 		}
+ 
+@@ -558,7 +567,6 @@
+ 		{
+ 			if (AppHost != null) {
+ 				AppHost.Unload ();
+-				Thread.Sleep (2000);
+ 			}
+ 
+ 			AppHost = null;