Skip to content

Incoming N-EVENT-REPORT RSP messages during release cause deadlock / exception #10

Description

@tkim602

Describe the bug
We are currently facing an issue when releasing the association. I looks like N-EVENT-REPORT RSP messages are sometimes arriving or sent during the release procedure and cause 3 different kind of behaviours:

  • Everything works fine
  • We end up in a deadlock in the while not self._is_paused: loop inside release(self) of association.py
  • We get the following exception (full log attached):
Traceback (most recent call last):
  File "C:\Users\jacob.eckert\AppData\Local\Programs\Python\Python39\lib\threading.py", line 980, in _bootstrap_inner
    self.run()
  File "C:\Users\jacob.eckert\AppData\Local\Programs\Python\Python39\lib\threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "C:\code\py_env\lib\site-packages\pynetdicom\dul.py", line 445, in run_reactor
    self.state_machine.do_action(event)
  File "C:\code\py_env\lib\site-packages\pynetdicom\fsm.py", line 78, in do_action
    raise InvalidEventError(msg)
pynetdicom.fsm.InvalidEventError: Invalid event 'Evt9' for the current state 'Sta7'

Is there a way to ignore that kind of messages (unbinding the handler did not work) or any other clean solution? - Right now we are using a sleep before releasing so that no more N-EVENT-REPORT RSP messages are present.

Expected behavior
Having a clear and reproducable behaviour on every run

Steps To Reproduce
Receive a N-EVENT-REPORT RSP during assoc.release() call

Your environment

Windows-10-10.0.19044-SP0
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]
pydicom 2.3.1
pynetdicom 2.0.2

full_log.txt

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