Open itssimon opened 4 years ago
@itssimon : Thanks for your code. I believe your situation is unique as most applications won't have 1000+ open file descriptors floating around. I would flag your issue as an improvement. Someone else might find your code useful if they encounter the same issue.
+1 on this issue.
I am running into this as well, unfortunately this specific ticket didn't come up in my Google searches but I did find https://github.com/prompt-toolkit/python-prompt-toolkit/issues/354 and someone posted a fairly similar fix for this.
In a long-running process (e.g. a Celery worker) the following error occurs occasionally indicating that there are too many file descriptors for
select()
.select()
has a limitation on the number of file descriptors it can watch. Often this is 1024, at least on Unix systems.Below is a patched
SMBConnection
class that usespoll()
instead ofselect()
to work around this limitation. However,poll()
is only supported on Unix systems, which is why a potential PR to fix this would have to implement both methods depending on the OS.Just wanted to document this issue and workaround here to start with. If anyone wants to work on a PR that uses the above code, feel free to do so.