Skip to content

threading.Timer.isAlive deprecation #28

@parkl-ee

Description

@parkl-ee

I believe since Splunk 9.3, the internal python version changed from 3.7 to 3.9, which dropped a deprecated method within the threading library's Timer class: isAlive (threading.Timer.isAlive). It has been replaced with threading.Timer.is_alive

The traceback is fragmented into multiple events. However, this is the important part:
ERROR ExecProcessor [2270 ExecProcessor] - message from "/opt/splunk/bin/python3.9 /opt/splunk/etc/apps/SplunkVersionControl/bin/splunkversioncontrol_backup.py" AttributeError: 'Timer' object has no attribute 'isAlive'

This removed method is still being used within /bin/splunkversioncontrol_utility.py:38:
if not timer.isAlive():

In theory, we can replace line 38 with the following, preserving backwards compatibility:
if not getattr(timer, "isAlive", getattr(timer, "is_alive"))(): # Compatibility with >py3.8

Hoping this can be resolved quickly as it seems this app has been broken since the python version change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions