Closed g-pichler closed 1 month ago
Any regression test is always very welcome :)
Did those changes completely fixed your issue?
So far, yes. I'm running on Linux with Python 3.12. I did not test anything else, except for the tests in the github actions.
I'll try to write a regression test, but it cannot promise anything. It might be annoying to write as the fd is system dependent and maybe hard to reproduce in a unit test.
I added a unit test to the pull request. It does fail (on my system) with the current master
, but succeeds on #1078.
I was using watchdog extensively in a quite large application with many threads. It would occasionally result in
ValueError: filedescriptor out of range in select()
exceptions.After some searching, I believe that the culprit is indeed the
select.select()
call. On Linux the man page saysI tried to move to
select.poll()
in #1078. Maybe there is a better approach than manually checkinghasattr(select, 'poll')
. Let me know if this works or any other options are preferred. In order to avoid regressions, it might be wise to add a test that opens >1024 file descriptors and then uses watchdog or something along those lines. If this is required, I could take a stab at it.