Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eckertj opened this issue Mar 14, 2023 · 1 comment · Fixed by #998
Closed

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

eckertj opened this issue Mar 14, 2023 · 1 comment · Fixed by #998
Labels

Comments

@eckertj
Copy link

eckertj commented Mar 14, 2023

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

@scaramallion scaramallion added this to the v2.1.0 milestone Nov 17, 2023
@scaramallion scaramallion modified the milestones: v2.1.0, v2.2.0 May 30, 2024
@scaramallion scaramallion removed this from the v2.2.0 milestone May 17, 2025
@scaramallion
Copy link
Member

The state machine errors should be fixed, and hopefully the hanging but I couldn't reproduce it so I can't be sure one way or the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants