Explorar el Código

Document ``minfds`` and ``minprocs`` behavior change

Mike Naberezny hace 14 años
padre
commit
0d1f5d710b
Se han modificado 3 ficheros con 24 adiciones y 11 borrados
  1. 7 0
      CHANGES.txt
  2. 15 11
      docs/configuration.rst
  3. 2 0
      supervisor/options.py

+ 7 - 0
CHANGES.txt

@@ -21,6 +21,13 @@ Next release
 
 - Fixed ``supervisorctl --help`` output to show the correct program name.
 
+- The behavior of the configuration options ``minfds`` and ``minprocs`` has
+  changed.  Previously, if a hard limit was less than ``minfds`` or
+  ``minprocs``, supervisord would unconditionally abort with an error.  Now,
+  supervisord will attempt to raise the hard limit.  This may succeed if
+  supervisord is run as root, otherwise the error is printed as before.
+  Patch by Benoit Sigoure.
+
 3.0a10 (2011-03-30)
 -------------------
 

+ 15 - 11
docs/configuration.rst

@@ -269,12 +269,14 @@ follows.
 ``minfds``
 
   The minimum number of file descriptors that must be available before
-  supervisord will start successfully.  supervisord uses file
-  descriptors liberally, and will enter a failure mode when one cannot
-  be obtained fromt he OS, so it's useful to be able to specify a
-  minimum value to ensure it doesn't run out of them during execution.
-  This option is particularly useful on Solaris, which has a low
-  per-process fd limit by default.
+  supervisord will start successfully.  A call to setrlimit will be made
+  to attempt to raise the soft and hard limits of the supervisord process to
+  satisfy ``minfds``.  The hard limit may only be raised if supervisord
+  is run as root.  supervisord uses file descriptors liberally, and will
+  enter a failure mode when one cannot be obtained from the OS, so it's
+  useful to be able to specify a minimum value to ensure it doesn't run out
+  of them during execution. This option is particularly useful on Solaris,
+  which has a low per-process fd limit by default.
 
   *Default*:  1024
 
@@ -284,11 +286,13 @@ follows.
 
 ``minprocs``
 
-  The minimum nymber of process descriptors that must be available
-  before supervisord will start successfully.  Supervisor will enter a
-  failure mode when the OS runs out of process descriptors, so it's
-  useful to ensure that enough process descriptors are available upon
-  :program:`supervisord` startup.
+  The minimum number of process descriptors that must be available
+  before supervisord will start successfully.  A call to setrlimit will be
+  made to attempt to raise the soft and hard limits of the supervisord process
+  to satisfy ``minprocs``.  The hard limit may only be raised if supervisord
+  is run as root.  supervisord will enter a failure mode when the OS runs out
+  of process descriptors, so it's useful to ensure that enough process
+  descriptors are available upon :program:`supervisord` startup.
 
   *Default*:  200
 

+ 2 - 0
supervisor/options.py

@@ -1212,6 +1212,8 @@ class ServerOptions(Options):
             
             if (soft < min) and (soft != -1): # -1 means unlimited 
                 if (hard < min) and (hard != -1):
+                    # setrlimit should increase the hard limit if we are
+                    # root, if not then setrlimit raises and we print usage
                     hard = min
 
                 try: