The ThreadLocal class in koji.context doesn't really offer anything over threading.local. Better to just use the standard python implementation.
ThreadLocal
The only reason this class exists is that it predates the threading library (added in python-2.4), or at least the availability of python-2.4 in RHEL. The code works, so there was never a reason to change it.
However, I discovered a deficiency this week. The koji ThreadLocal class will not purge data for expired threads. If a threaded app uses it and cycles through new threads regularly, then this could leak resources. Python's implementation does not share this flaw.
Metadata Update from @tkopecek: - Pull-request tagged with: no_qe
Commit 8e550984 fixes this pull-request
Pull-Request has been merged by tkopecek
Fixes https://pagure.io/koji/issue/4365
The
ThreadLocalclass in koji.context doesn't really offer anything over threading.local. Better to just use the standard python implementation.