diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-01-23 18:51:33 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-01-23 18:51:33 -0500 |
commit | 33c6e4013874878f05eec593d69e8afdeaae212b (patch) | |
tree | e84879dd215ac90d20822ab0574dc1ab99b7ed8a /func/forkbomb.py | |
parent | 19e4d1ba808cbbe95568271a5b0075b8422e4fb6 (diff) | |
download | func-33c6e4013874878f05eec593d69e8afdeaae212b.tar.gz func-33c6e4013874878f05eec593d69e8afdeaae212b.tar.xz func-33c6e4013874878f05eec593d69e8afdeaae212b.zip |
Working on async error handling, lots more to do...
(If it hits no exceptions, returns are right, it's the partial error case to deal with next...)
Diffstat (limited to 'func/forkbomb.py')
-rw-r--r-- | func/forkbomb.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/func/forkbomb.py b/func/forkbomb.py index daad28a..3dc12c8 100644 --- a/func/forkbomb.py +++ b/func/forkbomb.py @@ -20,6 +20,7 @@ import bsddb import sys import tempfile import fcntl +import utils DEFAULT_FORKS = 4 DEFAULT_CACHE_DIR = "/var/lib/func" @@ -52,11 +53,16 @@ def __access_buckets(filename,clear,new_key=None,new_value=None): if not storage.has_key("data"): storage["data"] = {} + else: + # print "DEBUG: existing: %s" % storage["data"] + pass if new_key is not None: # bsdb is a bit weird about this newish = storage["data"].copy() + new_value = utils.remove_exceptions(new_value) newish[new_key] = new_value + # print "DEBUG: newish: %s" % newish storage["data"] = newish rc = storage["data"].copy() @@ -118,7 +124,7 @@ def __demo(bucket_number, buckets, my_item): This is a demo handler for test purposes. It just multiplies all numbers by 1000, but slowly. """ - print ">> I am fork (%s) and I am processing item (%s)" % (bucket_number, my_item) + # print ">> I am fork (%s) and I am processing item (%s)" % (bucket_number, my_item) # just to verify forks are not sequential sleep = random.randrange(0,4) time.sleep(sleep) |