dmwm / WMCore

Core workflow management components for CMS.
Apache License 2.0
46 stars 107 forks source link

Watchdog.IsAlive() does not work in python 3.9 #12109

Closed khurtado closed 1 month ago

khurtado commented 1 month ago

Impact of the new feature The WMRuntime class Watchdog: https://github.com/dmwm/WMCore/blob/27830097328292d47828b84015018569a84896b1/src/python/WMCore/WMRuntime/Watchdog.py#L30

inherits from threading.Thread. Starting python 3.9, threading.Thread().isAlive() becomes is_alive().

Is your feature request related to a problem? Please describe. Unit tests broken in Alma9 nodes with python 3.9: Unit

Describe the solution you'd like Python 3.6.8+ have support for is_alive. Change unit test method name to it.

Describe alternatives you've considered Implement isAlive() in python 3.9 as well

amaltaro commented 1 month ago

@khurtado can you please provide the unit test and the error/traceback to this issue (or the original description)?

I don't see isAlive() being used anywhere other than the Daemon object (which is a different isAlive() method). In addition, this issue should have been fixed by this PR: https://github.com/dmwm/WMCore/pull/11323 , so it is not clear to me now why a new method is created and why it fails.

khurtado commented 1 month ago

@amaltaro

In python 3.9, we fail this line in the following unit test:

https://github.com/dmwm/WMCore/blob/master/test/python/WMCore_t/Misc_t/Runtime_t.py#L76

Python 3.9 deprecates isAlive(), but I failed to see python 3.6.8+ implemented both isAlive() and is_alive(), so it seems simply changing the unit test should be fine.

I am changing this issue's description and creating a different PR