From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#18880: 25.0.50; inotify-based file notifications missing sometimes Date: Tue, 28 Oct 2014 17:11:10 -0700 Message-ID: <87sii7envl.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414541543 5700 80.91.229.3 (29 Oct 2014 00:12:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2014 00:12:23 +0000 (UTC) To: 18880@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 29 01:12:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XjGs5-0000Xp-Bw for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Oct 2014 01:12:17 +0100 Original-Received: from localhost ([::1]:41906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGs4-00072o-SF for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Oct 2014 20:12:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGrw-00072U-CR for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:12:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjGrq-0007AI-S4 for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:12:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGrq-0007A6-PD for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XjGrq-0003eP-Fh for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Oct 2014 00:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18880 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141454149713989 (code B ref -1); Wed, 29 Oct 2014 00:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Oct 2014 00:11:37 +0000 Original-Received: from localhost ([127.0.0.1]:38067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjGrQ-0003dX-Vf for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53961) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjGrO-0003dK-NV for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjGrD-00071W-5W for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:28 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGrD-00071S-37 for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGr7-00070F-Th for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:11:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjGr2-00070U-Qn for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:11:17 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:57425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGr2-00070P-IF for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:11:12 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C0F0F20BA5 for ; Tue, 28 Oct 2014 20:11:11 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Tue, 28 Oct 2014 20:11:11 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=s5q7GHmUb72GQmYraJ0dz0KES9I=; b=E81Z jRN2sXVLhj/gGkFGDsrnE3YCaJHQMC/UsBYrsLzy6yNk89Cfc2abjMkPOkjZNn7H w3j1+VkeX8IP2tkMTz++w6O7l1H7e+rEGrktd+zDFO7d4OH3kcOQ3Ni80LjerEBt QRNmo3qK6UnECkh5Q33OQk0+Z0k+bP/f2MlEJrQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=s5q7GHmUb72 GQmYraJ0dz0KES9I=; b=jDeDOP1dp9IPXXq8OvWhmegvxAyqKRmg/YlYKWODCLN Zj4BwqYumGEaCAcnd1aNAOz1LE9yP01QraygmpcgzqJikrIU24NWNbhIou5wQvqF m0LuhsJxarO3sEHkVG0Pt4f3Cvf/J0QRxSlPOWFgJKihS4sUrmOHbpoDc0GdcQm8 = X-Sasl-enc: pQnRLEf+vCDTsL0zkM11YuFYjwuE1C1orJWYuIJRcR1w 1414541471 Original-Received: from shorty.local (unknown [23.243.192.221]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C131680142 for ; Tue, 28 Oct 2014 20:11:11 -0400 (EDT) Original-Received: from dima by shorty.local with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XjGr0-0004y6-GF for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 17:11:10 -0700 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95225 This bug is about an issue on the emacs-devel-mailing list: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00911.html The main message is copied below: I ran into an issue with inotify-base file notifications when looking at auto-revert stuff from an earlier thread. To show the issue, I build the latest emacs from source using ./configure --with-file-notification=inotify I then run ./emacs --eval "`cat /tmp/tstnotify.el`" -Q -nw with tstnotify.el being (progn (require 'filenotify) (dolist (fil '("/tmp/tst1" "/tmp/tst2")) (file-notify-add-watch fil '(change attribute-change) (lambda (event) (message "notify event %s" event))) (find-file fil)) (switch-to-buffer "*Messages*")) Here I ask for notifications for two files, and print out the events as they come in. While emacs is running this way, I modify those two files using an external tool. I would expect to see modification events for both of these files, but I only see them for one of the files. The issue is that emacs doesn't ask inotify to look at the two files, it asks it to look at the containing directory (/tmp in both cases), filtering out all the files we don't care about later. inotify is being intelligent, notices that we're asking to monitor the same object twice (/tmp), and simply returns the same descriptor a second time. Emacs is assuming a unique descriptor, and the result is that we only get notifications for one file.