pkgset: Handle exceptions in pkgset threads
There are two thread pools for making package sets. If Pungi is being terminated by external event and the exception is handled in the first thread, the second one never gets to the `stop` method and the process keeps hanging. This patch should make sure that `stop()` is called on both pools. JIRA: RHELCMP-2459 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
b3a55fd863
commit
22efe15379
@ -271,7 +271,12 @@ class MaterializedPackageSet(object):
|
||||
|
||||
small_pool.start()
|
||||
big_pool.start()
|
||||
try:
|
||||
small_pool.stop()
|
||||
except Exception:
|
||||
big_pool.kill()
|
||||
raise
|
||||
finally:
|
||||
big_pool.stop()
|
||||
|
||||
return small_pool.results + big_pool.results
|
||||
|
Loading…
Reference in New Issue
Block a user