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
1 changed files with 7 additions and 2 deletions
|
|
@ -271,8 +271,13 @@ class MaterializedPackageSet(object):
|
|||
|
||||
small_pool.start()
|
||||
big_pool.start()
|
||||
small_pool.stop()
|
||||
big_pool.stop()
|
||||
try:
|
||||
small_pool.stop()
|
||||
except Exception:
|
||||
big_pool.kill()
|
||||
raise
|
||||
finally:
|
||||
big_pool.stop()
|
||||
|
||||
return small_pool.results + big_pool.results
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue