Subject: bug#21432: 25.0.50; file-notify-rm-watch (inotify) errors if watched dir is deleted

From: Michael Albinus <[email-masked]>
Date: Tue, 15 Sep 2015 13:54:08 +0200

Eli Zaretskii <[email-masked]> writes:

>   ======================================================================
>   1 -> (file-notify-handle-event (file-notify (100272320 added
> ".#-emacsa05420") file-notify-callback))
>   | 2 -> (file-notify-callback (100272320 added ".#-emacsa05420"))
>   | 2 <- file-notify-callback: nil
>   1 <- file-notify-handle-event: nil
>   ======================================================================
>   1 -> (file-notify-handle-event (file-notify (100272320 modified
> ".#-emacsa05420") file-notify-callback))
>   | 2 -> (file-notify-callback (100272320 modified ".#-emacsa05420"))
>   | 2 <- file-notify-callback: nil
>   1 <- file-notify-handle-event: nil
>
> I'm confused: why does it mention a lock file instead of some file in
> temporary-file-directory?  Is some variable missing a value?

Well, the lock files are from the write-region call. I see something
similar for inotify:

======================================================================
1 -> (file-notify-handle-event (file-notify (2 (create) ".#file-notify-test20231Yhx" 0) file-notify-callback))
| 2 -> (file-notify-callback (2 (create) ".#file-notify-test20231Yhx" 0))
| 2 <- file-notify-callback: nil
1 <- file-notify-handle-event: nil
======================================================================
1 -> (file-notify-handle-event (file-notify (2 (create) "file-notify-test20231Yhx" 0) file-notify-callback))
| 2 -> (file-notify-callback (2 (create) "file-notify-test20231Yhx" 0))
| | 3 -> (file-notify--test-event-handler ((2 . "file-notify-test20231Yhx") created "/tmp/file-notify-test-parent20231LXr/file-notify-test20231Yhx"))
| 2 <- file-notify-callback: nil
1 <- file-notify-handle-event: nil
======================================================================
1 -> (file-notify-handle-event (file-notify (2 (modify) "file-notify-test20231Yhx" 0) file-notify-callback))
| 2 -> (file-notify-callback (2 (modify) "file-notify-test20231Yhx" 0))
| | 3 -> (file-notify--test-event-handler ((2 . "file-notify-test20231Yhx") changed "/tmp/file-notify-test-parent20231LXr/file-notify-test20231Yhx"))
| 2 <- file-notify-callback: nil
1 <- file-notify-handle-event: nil
======================================================================
1 -> (file-notify-handle-event (file-notify (2 (delete) ".#file-notify-test20231Yhx" 0) file-notify-callback))
| 2 -> (file-notify-callback (2 (delete) ".#file-notify-test20231Yhx" 0))
| 2 <- file-notify-callback: nil
1 <- file-notify-handle-event: nil
======================================================================
1 -> (file-notify-handle-event (file-notify (2 (delete) "file-notify-test20231Yhx" 0) file-notify-callback))
| 2 -> (file-notify-callback (2 (delete) "file-notify-test20231Yhx" 0))
| | 3 -> (file-notify--test-event-handler ((2 . "file-notify-test20231Yhx") deleted "/tmp/file-notify-test-parent20231LXr/file-notify-test20231Yhx"))
| 2 <- file-notify-callback: nil
1 <- file-notify-handle-event: nil
======================================================================
1 -> (file-notify-handle-event (file-notify (2 (ignored) nil 0) file-notify-callback))
| 2 -> (file-notify-callback (2 (ignored) nil 0))
| 2 <- file-notify-callback: nil
1 <- file-notify-handle-event: nil

`file-notify--test-event-handler' hasn't been called for the lock files,
because it was enabled for the test file only (that's the intention of
this test case). It isn't clear to me why
`file-notify--test-event-handler' hasn't been called for your test
file. That must be something in w32notify.c.

Best regards, Michael.