From 3853c5c0da95650342dd87327cf10e626b07074e Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 14 Oct 2011 14:06:24 +0200 Subject: [PATCH] Build the real-time monitor by default on FreeBSD (depend on USE_FAM). Fix a few glitches in the fam/gamin version --- src/configure | 3 ++- src/configure.ac | 3 ++- src/index/rclmonrcv.cpp | 18 +++++++++++++----- website/BUGS.html | 8 ++++---- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/configure b/src/configure index a6d44a0f..1c507fd9 100755 --- a/src/configure +++ b/src/configure @@ -4243,9 +4243,10 @@ fi if test "${with_fam+set}" = set; then : withval=$with_fam; withFam=$withval else - withFam=no + withFam=yes fi + if test X$withFam != Xno -a X$withInotify != Xno ; then { $as_echo "$as_me:${as_lineno-$LINENO}: FAM support enabled but inotify support also enabled. Disabling FAM support and using inotify" >&5 $as_echo "$as_me: FAM support enabled but inotify support also enabled. Disabling FAM support and using inotify" >&6;} diff --git a/src/configure.ac b/src/configure.ac index f58609ad..dbae3f03 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -119,7 +119,8 @@ fi AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam], [Use File Alteration Monitor for almost real time indexing of modified files. Give the fam/gamin library as argument (ie: /usr/lib/libfam.so) if configure does not find the right one.]), - withFam=$withval, withFam=no) + withFam=$withval, withFam=yes) + if test X$withFam != Xno -a X$withInotify != Xno ; then AC_MSG_NOTICE([FAM support enabled but inotify support also enabled. Disabling FAM support and using inotify]) withFam=no diff --git a/src/index/rclmonrcv.cpp b/src/index/rclmonrcv.cpp index 413cbe70..e05d11b4 100644 --- a/src/index/rclmonrcv.cpp +++ b/src/index/rclmonrcv.cpp @@ -179,6 +179,10 @@ void *rclMonRcvRun(void *q) LOGERR(("rclMonRcvRun: tree walk failed\n")); goto terminate; } + if (walker.getErrCnt() > 0) { + LOGINFO(("rclMonRcvRun: fs walker errors: %s\n", + walker.getReason().c_str())); + } } { @@ -218,10 +222,14 @@ void *rclMonRcvRun(void *q) LOGDEB(("rclMonRcvRun: walking new dir %s\n", ev.m_path.c_str())); if (walker.walk(ev.m_path, walkcb) != FsTreeWalker::FtwOk) { - LOGERR(("rclMonRcvRun: failed walking new dir %s\n", - ev.m_path.c_str())); + LOGERR(("rclMonRcvRun: walking new dir %s: %s\n", + ev.m_path.c_str(), walker.getReason().c_str())); goto terminate; } + if (walker.getErrCnt() > 0) { + LOGINFO(("rclMonRcvRun: fs walker errors: %s\n", + walker.getReason().c_str())); + } } } @@ -241,7 +249,7 @@ terminate: bool eraseWatchSubTree(map& idtopath, const string& top) { bool found = false; - LOGDEB0(("Clearing map for [%s]\n", top.c_str())); + MONDEB(("Clearing map for [%s]\n", top.c_str())); map::iterator it = idtopath.begin(); while (it != idtopath.end()) { if (it->second.find(top) == 0) { @@ -461,8 +469,8 @@ bool RclFAM::getEvent(RclMonEvent& ev, int msecs) ev.m_etyp = RclMonEvent::RCLEVT_DELETE; // We would like to signal a directory here to enable cleaning // the subtree (on a dir move), but can't test the actual file - // which is gone. Let's rely on the fact that a directory - // should be watched + // which is gone, and fam doesn't tell us if it's a dir or reg. + // Let's rely on the fact that a directory should be watched if (eraseWatchSubTree(m_idtopath, ev.m_path)) ev.m_etyp |= RclMonEvent::RCLEVT_ISDIR; break; diff --git a/website/BUGS.html b/website/BUGS.html index 45079a9c..d02f532a 100644 --- a/website/BUGS.html +++ b/website/BUGS.html @@ -43,7 +43,7 @@ unexpected. This is probably dependant on the type of system and/or locale. Workaround: arrange for the offending file not to be indexed (move it away or configure it out), or - apply this patch, + apply this patch, which should work with all versions from 1.13 to 1.16.1
  • Under certain conditions, the indexer can use all available memory and crash. This is caused by a memory leak @@ -51,7 +51,7 @@ triggered in specific conditions (all cases seen were from files inside zip archives). Workaround: arrange for the offending file not to be indexed (move it away or configure - it out), or apply this + it out), or apply this patch, which should work with all versions from 1.13 to 1.16.1
  • Real time indexer: when running with gamin on FreeBSD, the @@ -64,14 +64,14 @@ all. Workaround: restart indexer from time to time.
  • Recollq does not delete a temporary directory in some cases (/tmp/rcl...).
  • +
  • Most GUI queries are actually run two times which does not + help performance...
  • Cancelling a preview in the GUI will also cancel the indexing thread if it is running.
  • After an upgrade, the recoll GUI sometimes crashes on startup. This is fixed by removing (back it up just in case) ~/.config/Recoll.org/recoll.conf, the QSettings storage for recoll.
  • -
  • Most GUI queries are actually ran two times which does not - help performance...
  • Under Solaris, it is necessary to perform the initial indexing with the recollindex program. For some unknown reason, the recoll index thread does not work for creating the database.