[Mono-bugs] [Bug 73358][Min] New - mod_mono is forking processes more often than is desirable

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 4 Mar 2005 14:10:40 -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=73358

--- shadow/73358	2005-03-04 14:10:40.000000000 -0500
+++ shadow/73358.tmp.13058	2005-03-04 14:10:40.000000000 -0500
@@ -0,0 +1,60 @@
+Bug#: 73358
+Product: Mono: Tools
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: mod_mono
+AssignedTo: gonzalo@ximian.com                            
+ReportedBy: rlyon@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mod_mono is forking processes more often than is desirable
+
+mod_mono is forking mod-mono-server processes more often than is 
+desirable.  The mod-mono-server will immmediately quit, but it would be 
+better to stop before the fork.
+
+Here is a possible fix that will not get remove the initial forks, but it 
+will remove the rest (this fix unfortuntly causes mod-mono-server to 
+complain a little):
+
+Index: src/mod_mono.c
+===================================================================
+--- src/mod_mono.c	(revision 41376)
++++ src/mod_mono.c	(working copy)
+@@ -1297,10 +1305,26 @@
+ 		if (xsp->status != FORK_NONE)
+ 			continue;
+ 
+-		xsp->status = FORK_INPROCESS;
+-		DEBUG_PRINT (0, "Forking %s", xsp->alias);
+-		fork_mod_mono_server (pconf, xsp);
+-		xsp->status = FORK_SUCCEEDED;
++        // try connect
++#ifdef APACHE13
++        sock = apr_pcalloc (pconf, sizeof (apr_socket_t));
++#endif
++        rv = setup_socket (&sock, xsp, pconf, TRUE);
++        
++        if (rv == APR_SUCCESS)
++        {
++            /* connected */
++            DEBUG_PRINT (0, "connected %s", xsp->alias);
++            apr_socket_close (sock);
++        }
++        else
++        {
++            /* need fork */
++            xsp->status = FORK_INPROCESS;
++    		DEBUG_PRINT (0, "forking %s", xsp->alias);
++    		fork_mod_mono_server (pconf, xsp);
++    		xsp->status = FORK_SUCCEEDED;
++        }
+ 	}
+ }