diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-01-13 16:05:30 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-01-13 16:05:30 -0500 |
commit | 820cb35f0ac38dfc49b2369e330056d95eaca7ec (patch) | |
tree | 791b51a416f78f2ae9f724bbcc2f4873f67812a6 /func/overlord | |
parent | fb2ac06f7a914a488f7f544d2463a4d007764496 (diff) | |
download | func-820cb35f0ac38dfc49b2369e330056d95eaca7ec.tar.gz func-820cb35f0ac38dfc49b2369e330056d95eaca7ec.tar.xz func-820cb35f0ac38dfc49b2369e330056d95eaca7ec.zip |
No, you can't have just one bucket.
Diffstat (limited to 'func/overlord')
-rw-r--r-- | func/overlord/forkbomb.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/func/overlord/forkbomb.py b/func/overlord/forkbomb.py index 8d7fb31..1ff529d 100644 --- a/func/overlord/forkbomb.py +++ b/func/overlord/forkbomb.py @@ -72,6 +72,7 @@ def __bucketize(pool, slots): """ buckets = {} count = 0 + # print "DEBUG: slots: %s" % slots for key in pool: count = count + 1 slot = count % slots @@ -129,9 +130,13 @@ def batch_run(pool,callback,nforks=DEFAULT_FORKS,cachedir=DEFAULT_CACHE_DIR): the workload over nfork forks. Temporary files used during the operation will be created in cachedir and subsequently deleted. """ + if nforks <= 1: + # modulus voodoo gets crazy otherwise and bad things happen + nforks = 2 shelf_file = __get_storage("~/.func") __access_buckets(shelf_file,True,None) buckets = __bucketize(pool, nforks) + # print "DEBUG: buckets: %s" % buckets __forkbomb(1,buckets,callback,shelf_file) rc = __access_buckets(shelf_file,False,None) os.remove(shelf_file) |