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 5e90d77..fa73746 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: