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

inotify: don't ignore events for files that don't exist #470

Merged
merged 1 commit into from Jul 29, 2022
Merged

Commits on Jul 24, 2022

  1. inotify: don't ignore events for files that don't exist

    This is quite an odd check, leading to an inconsistent event stream,
    which also doesn't match what other platforms do. If you do a "CREATE +
    MODIFY + REMOVE" in quick succession then you probably *want* all three
    events. If you don't want to operate on non-existing files, then you can
    check this in your application code.
    
    You need to do that already, since this check is far from reliable. In
    the time between this check and the application code doing something
    with an event the file may have been deleted already.
    
    I looked a bit at the history of this, and looks like it was added in
    2013 with cc2c34e; issue 36 refers to this issue on the old repo, which
    mentions it fixes a memory leak: howeyc/fsnotify#36
    
    I can't reproduce that at all; using the CLI from #463 modified to print
    the memory and running:
    
    	for i in $(seq 0 10000); { touch $i; rm $i }
    
    Memory stays at about 100/110K in both the current main branch and this.
    
    So I think it should be safe to remove.
    arp242 committed Jul 24, 2022
    Copy the full SHA
    b1112f8 View commit details
    Browse the repository at this point in the history