Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: services: extend important limits to their hard limit
......................................................................

packaging: services: extend important limits to their hard limit

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1057654
Change-Id: Ib9f89a1519cf895e0e1504b3e344c9d0fc1481d6
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M packaging/pythonlib/ovirt_engine/service.py
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/55/23755/1

diff --git a/packaging/pythonlib/ovirt_engine/service.py 
b/packaging/pythonlib/ovirt_engine/service.py
index a82e04c..0638363 100644
--- a/packaging/pythonlib/ovirt_engine/service.py
+++ b/packaging/pythonlib/ovirt_engine/service.py
@@ -23,6 +23,7 @@
 import subprocess
 import sys
 import time
+import resource
 import gettext
 _ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine')
 
@@ -362,6 +363,12 @@
 
             raise
 
+    def _setLimits(self):
+        self.logger.debug('Setting rlimits')
+        for limit in (resource.RLIMIT_NPROC, resource.RLIMIT_NOFILE):
+            soft, hard = resource.getrlimit(resource.RLIMIT_NPROC)
+            resource.setrlimit(resource.RLIMIT_NPROC, (hard, hard))
+
     def _daemon(self):
 
         self.logger.debug('daemon entry pid=%s', os.getpid())
@@ -401,6 +408,8 @@
         ):
             self.logger.debug('I am a daemon %s', os.getpid())
 
+            self._setLimits()
+
             try:
                 with PidFile(self._options.pidfile):
                     self.daemonContext()


-- 
To view, visit http://gerrit.ovirt.org/23755
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9f89a1519cf895e0e1504b3e344c9d0fc1481d6
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to