Subject: Re: bug#48067: 28.0.50; Tramp error: cannot determine gio monitor

From: Thierry Volpiatto <[email-masked]>
Date: Thu, 29 Apr 2021 05:33:08 +0000

Michael Albinus <[email-masked]> writes:

> [[PGP Encrypted Part:OK]]
> Thierry Volpiatto <[email-masked]> writes:
>
>> This happen on emacs-27:
>>
>> ;; file-notify-handle-event (file-notify (#<process gio<4>> (changes-done-hint) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)
>> ;; file-notify-handle-event (file-notify (#<process gio<4>> (attribute-changed) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)
>>
>> On emacs-28 nothing happen when modifying externally same directory
>> (tmp).
>
> Strange. Have you tried "M-x tramp-cleanup-all-connections"? Prior to
> connecting the remote machine.

I always start a new emacs session for debugging.

> Otherwise, I have no idea (it works for me as I have shown).

No, it is not the same example, please bear with me, try with same
conditions and with tramp-debug and file-notify-debug set:

1) Install helm

2) open a terminal outside emacs

3) run in emacs helm-find-files and navigate to /sudo::/home/you/tmp/

4) go to the terminal opened in 2) and touch ~/tmp/test.txt

5) go back to emacs and see nothing happened

Now do the same from emacs-27 and see in 5) that an *rm-watch happened.

Here the relevant logs for emacs-28 and emacs-27:

;; Emacs 28
001 07:12:50.967691 tramp-sh-gio-monitor-process-filter (6) # #<process gio<4>>
002 (gio monitor:29342): GLib-GIO-1;33mWARNING0m **: 34m07:12:50.946[0m: Can't find module 'help' specified in GIO_USE_FILE_MONITOR
003 07:12:50.967794 tramp-get-connection-property (7) # gio-file-monitor undef; cache used: nil
004 07:12:50.967879 tramp-set-connection-property (7) # gio-file-monitor undef
005 07:12:54.974248 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p t; inhibit: 10; cache used: t; cached at: 07:12:50
006 07:13:00.401319 tramp-sh-gio-monitor-process-filter (6) # #<process gio<4>>
007 /home/thierry/tmp: /home/thierry/tmp/test.txt: created
008 /home/thierry/tmp: /home/thierry/tmp/test.txt: changes done
009 /home/thierry/tmp: /home/thierry/tmp/test.txt: attributes changed
010 07:13:00.401503 tramp-get-connection-property (7) # gio-file-monitor undef; cache used: nil
011 07:13:00.401656 tramp-sh-gio-monitor-process-filter (10) # Rest string:
012 /home/thierry/tmp: /home/thierry/tmp/test.txt: created
013 /home/thierry/tmp: /home/thierry/tmp/test.txt: changes-done-hint
014 /home/thierry/tmp: /home/thierry/tmp/test.txt: attribute-changed
015 07:13:10.485947 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p undef; inhibit: 10; cache used: nil; cached at: 07:12:50

;; Emacs 27
001 07:21:11.964043 tramp-sh-gio-monitor-process-filter (6) # #<process gio<4>>
002 /home/thierry/tmp: /home/thierry/tmp/test.txt: created
003 /home/thierry/tmp: /home/thierry/tmp/test.txt: changes done
004 /home/thierry/tmp: /home/thierry/tmp/test.txt: attributes changed
005 07:21:11.980001 tramp-accept-process-output (10) # gio<4> 0 run nil
006 07:21:11.980151 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio<4>>
007 07:21:11.980343 tramp-file-notify-process-sentinel (5) # Sentinel called: `#<process gio<4>>' `processus arrêté'
008 07:21:11.980657 tramp-accept-process-output (10) # gio<4> 0 signal nil
009 07:21:11.980747 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio<4>>
010 07:21:11.988139 tramp-sh-gio-monitor-process-filter (10) # Rest string:

You can see that in line 009 in emacs-27 log an *rm-watch happen whereas
in emacs28 it doesn't happen.

> Is there a chance I could debug, connecting your remote machine?

Yes sure, I have just to create an account with an installed emacs28 for
you, but please try first on your side with same recipe.

> Otherwise, I would need to write special instrumentations in
> tramp-sh-gio-monitor-process-filter just for you.
>
> Best regards, Michael.
>
>
> [[End of PGP Encrypted Part]]

-- 
Thierry