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
Slow timeout when trying to connect to an invalid IP address #616
Comments
Howdy - also experiencing this issue. My 2c: #565 and #600 are close to being right except:
If you'd like I can propose a fix in a PR. Thanks! |
Sure, that'd be great |
@scaramallion one complication here is that we don't want the
the way things currently work, the ACSE provider doesn't know anything about the underlying socket and starts its timer as soon as it attempts to establish an association: https://github.com/pydicom/pynetdicom/blob/master/pynetdicom/acse.py#L425-L426 open to any suggestions on how to proceed - i'm not sure what the right thing to do here is |
my best guess rn is "the DUL should not be marked ready until the transport connection is open" |
After writing all the below, the simplest simplest way is to probably just put The state machine for the start of association requests is
Where
So while we're operating in Sta4, the ACSE timeout should be idle until Evt2 occurs and we reach Sta5. There seems to be a step missing in I'd be inclined to put in a timeout check (based on network_timeout?) in between that waits on Sta5. self.send_request()
while self.assoc.dul.state_machine.state != 'Sta5':
# wait until timeout expires
evt.trigger(self.assoc, evt.EVT_REQUESTED, {}) It's probably better to use a threading event there with the other end tied to the socket.connect() code so the ACSE only containues once the connection request is made or failed. Alternatively you could just lock the thread into the socket.connect() code until timeout... but that might have weird effects when running an AE with multiple SCPs that needs to make association requests. I really hate threading.... |
Fixed with #618 |
From #615
python -m pynetdicom echoscu [invalid IP] 11112 -d -ta 5
Should immediately fail due to non-existent IP, but doesn't.
The text was updated successfully, but these errors were encountered: