chiark / gitweb /
Remove otiose debug messages defer-loop
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 18 Oct 2024 16:39:20 +0000 (17:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 18 Oct 2024 16:39:44 +0000 (17:39 +0100)
In certain operational circumstances, this can generate unreasonable
volumes of debug output (3-4 lines per attempt to process an article).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
filemon.c

index c531f40c32e15db0b182b701a3d4c40df4d6d001..24af5f5def007eaf649df31b5b2ff8a486c3ad28 100644 (file)
--- a/filemon.c
+++ b/filemon.c
@@ -35,11 +35,11 @@ static void filemon_method_startfile(InputFile *ipf, Filemon_Perfile *pf) {
   if (pf->wd < 0) sysdie("filemon inotify: inotify_add_watch %s", ipf->path);
 
   LIST_ADDHEAD(filemon_inotify_watches, pf);
-  dbg("filemon inotify: startfile %p wd=%d pf=%p", ipf, pf->wd, pf);
+  //dbg("filemon inotify: startfile %p wd=%d pf=%p", ipf, pf->wd, pf);
 }
 
 static void filemon_method_stopfile(InputFile *ipf, Filemon_Perfile *pf) {
-  dbg("filemon inotify: stopfile %p wd=%d pf=%p", ipf, pf->wd, pf);
+  //dbg("filemon inotify: stopfile %p wd=%d pf=%p", ipf, pf->wd, pf);
   int r= inotify_rm_watch(filemon_inotify_fd, pf->wd);
   if (r) syscrash("filemon inotify: inotify_rm_watch");
   LIST_REMOVE(filemon_inotify_watches, pf);
@@ -67,7 +67,10 @@ static void *filemon_inotify_readable(oop_source *lp, int fd,
      * unexpected random watch events as normal.  It's not a
      * correctness problem as the watch is just a prod to read a file,
      * which is harmless if it does not need to be read. */
-    dbg("filemon inotify: read event with unknown wd=%d", iev.wd);
+    /* When we are at the queue limit, each time we manage to process
+     * an article, we disable and re-enable the watch, and the disabled
+     * watch generates one or two of these "unknown wd" events. */
+    //dbg("filemon inotify: read event with unknown wd=%d", iev.wd);
     continue;
     
   found: