← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:buildd-manager-bump-open-files into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:buildd-manager-bump-open-files into launchpad:master.

Commit message:
daemons/buildd-manager.tac: Drop RLIMIT_NOFILE fiddling

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/450659

When I originally added code to change `RLIMIT_NOFILE` here, the intent was to _raise_ the limit from the relatively low OS default.  However, since then, we've switched to running `buildd-manager` from a systemd service deployed via a charm, and `charm/launchpad-buildd-manager/templates/launchpad-buildd-manager.service.j2` sets `LimitNOFILE=65536`; as a result, this code now has the effect of _lowering_ the limit.

Let's just rely entirely on the configuration in the systemd service.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:buildd-manager-bump-open-files into launchpad:master.
diff --git a/daemons/buildd-manager.tac b/daemons/buildd-manager.tac
index 8fa2bac..a1f8176 100644
--- a/daemons/buildd-manager.tac
+++ b/daemons/buildd-manager.tac
@@ -4,13 +4,11 @@
 # Twisted Application Configuration file.
 # Use with "twistd2.4 -y <file.tac>", e.g. "twistd -noy server.tac"
 
-import resource
-
 from twisted.application import service
 from twisted.scripts.twistd import ServerOptions
 
 from lp.buildmaster.manager import BuilddManager
-from lp.services.config import config, dbconfig
+from lp.services.config import dbconfig
 from lp.services.daemons import readyservice
 from lp.services.mail.sendmail import set_immediate_mail_delivery
 from lp.services.scripts import execute_zcml_for_scripts
@@ -28,16 +26,6 @@ set_immediate_mail_delivery(True)
 # role before starting any threads.
 setup_feature_controller("buildd-manager")
 
-# ampoule uses five file descriptors per subprocess (i.e.
-# 5 * config.builddmaster.download_connections); we also need at least three
-# per active builder for resuming virtualized builders or making XML-RPC
-# calls, we need to be able to make connections from time to time to the
-# keyserver for fetching keys or to the appserver for issuing macaroons, and
-# we also need to allow slack for odds and ends like database connections.
-soft_nofile = 5 * config.builddmaster.download_connections + 4096
-_, hard_nofile = resource.getrlimit(resource.RLIMIT_NOFILE)
-resource.setrlimit(resource.RLIMIT_NOFILE, (soft_nofile, hard_nofile))
-
 options = ServerOptions()
 options.parseOptions()