Closed shamim40 closed 4 months ago
AttributeError: partially initialized module 'hl7apy.v2_4' has no attribute 'get' (most likely due to a circular import)
this error occurred on multi-threading tcp server, looking forward to fix it.
finally released in 1.3.5
Hi, can you provide the details of the fix commit? I fixed it in my project just using threading lock
, this it not a elegant way.
with threading.Lock():
self.message = parse_message(
hl7_message,
find_groups=find_group,
validation_level=validation_level,
)
If multiple threads are trying to invoke hl7apy's parse_message(), each thread has it's own hl7 message, then it is crashing. If i add this under a thread lock, then multiple thread works with no issues, as below:
with threadLock: hl7_message = parse_message(hl7_data.replace('\n', '\r'), find_groups=False)
It seems to be parse_message() is not thread safe. If it is already fixed, then please provide in which version this has been fixed.