[Mono-bugs] [Bug 68854][Cri] Changed - mod_mono returns 503 when using the Apache 2 "worker" MPM

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 2 Feb 2005 23:51:51 -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.


--- shadow/68854	2005-02-01 20:54:05.000000000 -0500
+++ shadow/68854.tmp.10635	2005-02-02 23:51:51.000000000 -0500
@@ -142,6 +142,49 @@
   option from your scripts.
 An explanation of what is the workaround that you had in mind
 with mod_simias is would be useful.
 We have very a bad feeling about this mod_simias.
+------- Additional Comments From rlyon@novell.com  2005-02-02 23:51 -------
+I spent some time today looking at mod_mono and mod_simias with Mike.  
+I found the methods used to start and terminate mod-mono-server.exe 
+in both files are very similar. 
+Both mod_mono and mod_simias use the pool cleanup to terminate 
+mod-mono-server.exe.  The first uses a socket connection to send the 
+terminate, and second with the command.  The terminate in both cases 
+will only be called when apache shuts down (with one exception if you 
+register with the first init). 
+The important difference between mod_mono and mod_simias is that 
+mod_mono starts the mod-mono-server in the handler method and 
+mod_simias starts it in the child_init method. 
+mod_mono is not working with the "Worker" MPM because the process 
+that is available in the handler method is a "lightweight" process 
+and is not forkable (in the same way).  A process will be created for 
+the mod-mono-server, but it will never start. 
+I created a patch of mod_mono where I moved the fork into a 
+child_init method.  This new version of mod_mono has been working for 
+me with the "prefork" MPM and the "worker" MPM. 
+A few notes on the patch: 
+The child_init is, by default and on startup, called twice with 
+"worker" and five times with "prefork".  The patched version 
+currently tries to start mod-mono-server with each child_init -- with 
+only one succeeding.  If the solution is okay, I can add some 
+synchronization around the start to make the solution cleaner. 
+I think it will work with Apache 1.3, but I have not tested it. 
+In some cases, starting mod-mono-server in the handler provided 
+recovery.  A "baby-sitter" process could be provided to increase 
+recovery handling. 
+We looked at starting mod-mono-server in the init (post-config) 
+method, but at that point apache is still running as root.  It seemed 
+easier to use child_init, instead of changing the effective rights