Skip to content

Commit

Permalink
Use non-thread-local _store in RecordFactoryContextAdapter
Browse files Browse the repository at this point in the history
This needs to be thought about more carefully.
  • Loading branch information
hsinfang authored and kfindeisen committed Oct 12, 2023
1 parent 3d002eb commit 8aaa624
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/activator/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import json
import logging
import os
import threading
import types

import lsst.daf.butler as daf_butler

Expand Down Expand Up @@ -277,7 +277,9 @@ def __init__(self, factory):
self._old_factory = factory
# Record factories must be shared to be useful; keep all nontrivial
# state in a `local` object to emulate a thread-specific factory.
self._store = threading.local()
# But using threading.local seemed to cause error in some threads.
# TODO: fix this properly
self._store = types.SimpleNamespace()
self._store.context = {}

def __call__(self, *args, **kwargs):
Expand Down

0 comments on commit 8aaa624

Please sign in to comment.