#2715 acquire logging locks before forking
Merged by tkopecek. Opened by mikem.
mikem/koji kojira-rmtree-locks  into  master

Download 2715.patch

Fixes https://pagure.io/koji/issue/2714

A very simple test on my local system passes. Kojira is able to successfully delete repos.

Handler.__init__ calls createLock, so ther should be no case where handler without lock is present. Am I missing some case?

Wouldn't moving to multiprocessing.Process instead of fork() solving all these issues https://docs.python.org/3/library/multiprocessing.html#logging Maybe it would also simplify other things (we can use mp.Queue instead rm queue, etc.) But maybe it is a future improvement not needed to fix this issue.

Handler.init calls createLock, so ther should be no case where handler without lock is present. Am I missing some case?

Just trying to write defensively against possible variations in the logging lib

Wouldn't moving to multiprocessing.Process instead of fork() solving all these issues

There are definitely a few different ways to address this issue. I thought this one was the least impactful to the kojira code.

:thumbsup:

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

Commit 777ce228 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready
- Pull-request tagged with: no_qe

Metadata