-
-
Notifications
You must be signed in to change notification settings - Fork 701
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
Execution stuck when watching directory updated very fast by external program/script #700
Comments
I hit the same issue on one of my projects. This seems to be a Windows-only issue. When processing 120 files on windows, by dropping them all into an input directory, at the same time, Watchdog hangs after about 38 files. In this specific instance, the processing of the file takes about 5 seconds pr. file, but that should not affect the result. @mariantirlea I don't think there's anything wrong with your PC. It's simply the Windows API in Watchdog, that is not working as expected. |
@Zaph-x you could try to use a bigger buffer size: watchdog/src/watchdog/observers/winapi.py Line 267 in 3dea877
For example, here is what I am doing for years and it works pretty well: https://github.com/nuxeo/nuxeo-drive/blob/93bcdc54a5763a29b65efad10429cc7c20a82e8b/nxdrive/engine/watcher/local_watcher.py#L28-L36 |
@BoboTiG Thank you for this workaround! It seems to do the trick for now. While this solves the issue temporarily, I don't see it as an actual solution. The library should work equally well on both Linux and Windows, and the fact it just hangs doesn't seem right in my eyes. |
@Zaph-x maybe we could change those default values. It would be a simple improvement/fix. |
Hello @BoboTiG, I have tested with version 1.0.0 and I have the same problem. It works for the first execution but then it gets stuck and nothing is printed anymore in the console. Thank you very much, if this is not possible I will try to use polling for this. |
Your best bet would be to find out where it is stuck in the code. |
The code is very simple. I only scan a folder using default LoggingEventHandler and with recursive flag set to False. The folder "target" contains after execution: 99 Files and 39 Folders. Before each execution the folder content is deleted and new files are generated. What I can see it that some files are logged in the console after first execution but nothing is printer after the second/third execution. Somehow it remains blocked and no other events are detected from that point. If I will have the time I will try to fork the project and to debug it although I don't have experience with native Windows events.
|
Hello everyone,
I am tryting to use the watchdog (latest version) on a
target
folder from a Java project. This folder is updated every time I execute the Maven package command and I want to react on the changes of my package (created by the maven).The first time after I start the watchdog, I see all the changes in the log file but the second time there are no messages anymore...
Somehow the python script seems to be stuck (nothing is printed anymore).
This is like the basic example from the documentation and I cannot understand why is not working.
Then, I have cloned the repo and I have tried to execute the tests to see if everthing is fine on my PC, but one test is failing. I have extracted the difference:
The result of the tests:
Is there something wrong on my PC? How can I repair this test?
I think my first problem is caused by "rapid file created/modified". If I create files manually I see no problems but in my case I need to handle a folder where files are created very fast and a lot of them.
The text was updated successfully, but these errors were encountered: