diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-12-30 18:02:23 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2021-12-31 15:49:45 +0100 |
commit | 4ef050147556c3e751194f20887a9b27dff3a366 (patch) | |
tree | 8eaa71a7648e8f7206ded3682890dd350a21beb9 /multiarchimport.py | |
parent | c57a2009754f9778cc59cdb048cdb5e29496cb5e (diff) | |
download | debian-dedup-4ef050147556c3e751194f20887a9b27dff3a366.tar.gz |
multiarchimport.py: log exceptions from worker processes
Diffstat (limited to 'multiarchimport.py')
-rwxr-xr-x | multiarchimport.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/multiarchimport.py b/multiarchimport.py index af9d1c1..7271410 100755 --- a/multiarchimport.py +++ b/multiarchimport.py @@ -151,10 +151,13 @@ def bounded_imap_unordered(bound, pool, function, iterable): iterable = iter(iterable) results = queue.Queue() outstanding = 0 + def error_callback(exception): + logging.exception("worker exception", exc_info=exception) while iterable or outstanding: if iterable: for elem in iterable: - pool.apply_async(function, (elem,), callback=results.put) + pool.apply_async(function, (elem,), callback=results.put, + error_callback=error_callback) outstanding += 1 if outstanding >= bound or not results.empty(): break |