Skip to content
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

Monitoring of network shares #2

Open
abrain opened this issue Sep 10, 2016 · 3 comments
Open

Monitoring of network shares #2

abrain opened this issue Sep 10, 2016 · 3 comments

Comments

@abrain
Copy link
Contributor

abrain commented Sep 10, 2016

Hi,

for several months now I use your fs-file-lister node on a Raspberry Pi to check a network share for new PDF files. It gets triggered by an injection node in interval mode. The found files get moved from the mountpoint to the local file system.

Today I experienced the problem, that a file has been moved, but was 0 bytes in size. So I guess it has been moved while it still was being written.

The workaround for now is to skip events for files that are 0 bytes in size and to increase the time between two file listings. The safest way would probably be to cache events for several seconds to see if the file size changes, but I didn't have time to implement that yet.

Do you think this could be a feature of the existing or maybe even a new node specialized for network shares?

@TotallyInformation
Copy link
Owner

Ah, you seem to have found an edge case! In truth, the file lister isn't really designed with robust file moving in mind. At the least I should update the documentation with this limitation.

I think that you are always going to get issues like this on slow file systems. Have you tried using the watch node? It doesn't always work on network drives I think, but if it does, it would be a far more robust solution.

@abrain
Copy link
Contributor Author

abrain commented Sep 11, 2016

Yes, I tried the watch node, but it didn't work with the network share. That's why I chose the not-so-realtime approach to check every few seconds.

As far as I could see, the size remains 0 until the file is written completely. So my workaround seems to be ok for now.

I just wanted to let you know, in case you need some ideas to work on ;)

@TotallyInformation
Copy link
Owner

Thanks, at least I can update the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants