JeremyGrosser / tablesnap

Uses inotify to monitor Cassandra SSTables and upload them to S3
BSD 2-Clause "Simplified" License
181 stars 86 forks source link

Ignore IN_CREATE events by default #92

Closed mzbyszynski closed 6 years ago

mzbyszynski commented 6 years ago

pyinotify automatically notifies the tablesnap UploadHandler for IN_CREATE events if tablesnap is started with the --auto-add option, which causes all kinds of errors for tablesnap, since it starts copying the files to S3 before they are done being written. This pull request just adds a check that will prevent upload on IN_CREATE events unless that is directly specified via the --listen-events argument.

Let me know if this is the wrong way to fix this or if you see any other issues with this code.

This closes #91