#1446 pkgset: Handle exceptions in pkgset threads
Merged 3 years ago by lsedlar. Opened 3 years ago by lsedlar.
lsedlar/pungi pkgset-handle-exception  into  master

@@ -271,8 +271,13 @@ 

  

          small_pool.start()

          big_pool.start()

-         small_pool.stop()

-         big_pool.stop()

+         try:

+             small_pool.stop()

+         except Exception:

+             big_pool.kill()

If kill() doesn't require some after-cleanup, I am OK with it.

+             raise

+         finally:

+             big_pool.stop()

  

          return small_pool.results + big_pool.results

  

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.

Looks good to me. :thumbsup:

If kill() doesn't require some after-cleanup, I am OK with it.

The kill here doesn't even kill, it only indicates to worker threads that they should stop.

Pull-Request has been merged by lsedlar

3 years ago