-
Notifications
You must be signed in to change notification settings - Fork 103
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
Server refuses new credits after a certain time #332
Comments
Originally I did not consider this a hard error, leading to a disconnect, as there is a chance that - if there are still inflight requests - such a condition may be legitimately caused by client code using exzessive parallelism. However, I tend to agree that for most people this will be a non-recoverable error. We could probably even distinguish the two cases. Still, would be interesting to figure out what causes the credit issue in the first place. The least invasive would be something along the lines:
This uses internal APIs for which I don't want provide long term stability guarantees, but I don't see why these specific calls should change anytime soon. Calling SmbFile.getContext().getTransportPool().close() - compared to SmbFile.getContext().close() - would probably be more future proof. However, depending on your usage pattern this might also forcibly close other connnections besides the one you are interested in. |
Thanks for this detailed answer! The credits issue is indeed caused by excessive parallelism wrt to the server limitations (even 4 threads is too much). In that case I would like to be able to detect it, then reduce the number of parallel threads in my client and continue downloading. However if I only catch the SmbException notifying of the credits timeout then reduce the number of threads I still get the same issue. If I open a new connection it works. It may well be a server issue. The NAS is a consumer-grade one.
Maybe add a configuration option for this? |
Hello,
I am confronted to a NAS that rejects credits requests after a certain time (about 2h40 when downloading 80k files).
Then I get the 'Failed to acquire credits in time' error at every following request.
When restarting my whole connection it performs better and can again download for about 2h40/80k files.
I would like my connection to be more resilient:
Thanks!
The text was updated successfully, but these errors were encountered: