]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
buildds: kill aptitude after 10 minutes OR all RAM used
authorAurelien Jarno <aurelien@aurel32.net>
Fri, 28 Aug 2015 10:17:50 +0000 (12:17 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 28 Aug 2015 10:17:50 +0000 (12:17 +0200)
Instead of 10 minutes AND all RAM used. It takes ages to fill all the
RAM on machines with 8GB or 32GB.

modules/buildd/files/buildd-schroot-aptitude-kill

index 5e90d77ecc9575d19707a9519b506a09b2782a18..fa7374642317a8f32bc59f9f57be7d5039cb87af 100755 (executable)
@@ -54,10 +54,8 @@ for p in psutil.process_iter():
                if not rootdir.startswith('/var/lib/schroot/mount'): continue
                #
                used = p.get_memory_info().vms
-               if used < total_mem: continue
-               #
                cputime = p.get_cpu_times().user
-               if cputime < cutoff_time: continue
+               if used < total_mem and cputime < cutoff_time: continue
                #
                p.kill()
        except psutil.NoSuchProcess: