Skip to content
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

TCP connection not closed even after the association is aborted #979

Open
shoibahamed opened this issue Nov 5, 2024 · 4 comments
Open
Labels

Comments

@shoibahamed
Copy link

The PACS after sending images, does not release the association. Hence the "Network timeout" is triggered.
When the association is timed out and aborted by the scp, the TCP connection remains in the ESTAB state. And it will remain in the ESTAB state until the application is restarted

I see this error on the prod environment and the PACS is STENTOR. However, I could not reproduce on my local

New connections are opened for every association and they remain open and eventually and application hits maximum_associations and then rejects all other associations that are trying to be opened with the error message - "local limit exceeded"

@scaramallion
Copy link
Member

scaramallion commented Nov 6, 2024

Can you post your code, the anonymised output from debug_logger(), details of the production environment and which version of pynetdicom you're using?

@scaramallion
Copy link
Member

@shoibahamed it's difficult for me to reproduce this without more information.

@shoibahamed
Copy link
Author

shoibahamed commented Nov 29, 2024

I'm sorry for delay @scaramallion . I have been trying yo reproduce this and have not been able to. There are no error messages apart from notification that the association was aborted due to network timeout.
This happens only on 2 sites on production

The socket would just stay open until the application is restarted even after the associations is aborted and state machine showing state transitions

The code is running on docker container on image alpine:3.16
pynetdicom == 2.1.0

So I was able to overcome this issue by getting the socket from dul in the association abort event and manually closing it. Like this

socket_obj = assoc.dul.socket
if hasattr(socket_obj, 'socket'):
    socket_info = socket_obj.socket
    socket_info .shutdown(socket.SHUT_RDWR)

@scaramallion
Copy link
Member

No problem, thanks for the additional information.

@scaramallion scaramallion added bug and removed triage labels Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants