21223: Cast to int
authorPeter Amstutz <peter.amstutz@curii.com>
Tue, 28 Nov 2023 21:31:44 +0000 (16:31 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 28 Nov 2023 21:31:44 +0000 (16:31 -0500)
Also set up logging first so that any issues with setting NOFILE get
logged here.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

services/fuse/arvados_fuse/command.py

index bde96ade19ae7d116c6b6c512138c6b19e701c56..75ff4c132edb96ad40297935113aef243d2a6203 100644 (file)
@@ -134,6 +134,12 @@ class Mount(object):
         if self.args.logfile:
             self.args.logfile = os.path.realpath(self.args.logfile)
 
+        try:
+            self._setup_logging()
+        except Exception as e:
+            self.logger.exception("arv-mount: exception during setup: %s", e)
+            exit(1)
+
         try:
             nofile_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
 
@@ -143,7 +149,7 @@ class Mount(object):
                 # the desired cache size. Multiply by 8 because the
                 # number of 64 MiB cache slots that keepclient
                 # allocates is RLIMIT_NOFILE / 8
-                minlimit = (self.args.file_cache/(64*1024*1024)) * 8
+                minlimit = int((self.args.file_cache/(64*1024*1024)) * 8)
 
             if nofile_limit[0] < minlimit:
                 resource.setrlimit(resource.RLIMIT_NOFILE, (min(minlimit, nofile_limit[1]), nofile_limit[1]))
@@ -153,7 +159,6 @@ class Mount(object):
         self.logger.info("arv-mount: RLIMIT_NOFILE is %s", resource.getrlimit(resource.RLIMIT_NOFILE))
 
         try:
-            self._setup_logging()
             self._setup_api()
             self._setup_mount()
         except Exception as e: