You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing severe delays on the main python process exiting. I can take about 5 minutes to exit. I have to force it to exit by repeatedly sending SIGINT. I can see that the exception stacktrace printed shows that it is waiting on the disconnect request response here:
iter_timeout = int(max(timeout - (time.time() - start_time), 1)) if timeout is not None else None
if not request.response_event.wait(timeout=iter_timeout):
value = request.message["message_id"].get_value()
raise SMBException(
f"Connection timeout of {timeout} seconds exceeded while waiting for a message id {value} "
"response from the server"
)
This piece of code is reached atexit after calling smbclient.reset_connection_cache. I have tried calling it myself, before exiting, or keeping a smaller connection cache as suggested in #176. I have only had success by copying the contents of reset_connection_cache over, and passing a timeout to the connection.disconnect call. I can create a PR, but I wanted to make an issue first, so we can start a discussion on whether this is a sensible thing to do. My suggestion is to add a disconnect timeout parameter in ClientConfig, and using that in reset_connection_cache. I would imagine a sensible default would be 3-5 seconds.
The text was updated successfully, but these errors were encountered:
I think adding an option to the ClientConfig makes sense to shorten the time It would be nice to find out why something is taking 5 minutes to disconnect though, maybe the default doesn't make too much sense and we should just leave the server to reap any outstanding connections and keep our tidy up to be around 1-5 seconds.
I am experiencing severe delays on the main python process exiting. I can take about 5 minutes to exit. I have to force it to exit by repeatedly sending
SIGINT
. I can see that the exception stacktrace printed shows that it is waiting on the disconnect request response here:This piece of code is reached
atexit
after callingsmbclient.reset_connection_cache
. I have tried calling it myself, before exiting, or keeping a smaller connection cache as suggested in #176. I have only had success by copying the contents ofreset_connection_cache
over, and passing atimeout
to theconnection.disconnect
call. I can create a PR, but I wanted to make an issue first, so we can start a discussion on whether this is a sensible thing to do. My suggestion is to add a disconnect timeout parameter inClientConfig
, and using that inreset_connection_cache
. I would imagine a sensible default would be 3-5 seconds.The text was updated successfully, but these errors were encountered: