LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Courier IMAP + GAM server problems - Slack gamin package has patch? (http://www.linuxquestions.org/questions/slackware-14/courier-imap-gam-server-problems-slack-gamin-package-has-patch-4175507835/)

rpedrica 06-12-2014 06:36 AM

Courier IMAP + GAM server problems - Slack gamin package has patch?
 
I have a courier imap server which has been running along pretty nicely for a while but as user count has grown, I'm starting to get the following issues more often:

imapd: FAMPending: timeout

Access to Courier seems sluggish at times, and the clients will shows timeout errors on occasion. The Courier/GAM issue seems to be a well known and old issue but the fixes aren't necessarily clear.

The following bug report indicates the problem:

https://bugzilla.gnome.org/show_bug.cgi?id=667230

The slackware14 64-bit package for gamin ( gamin-0.1.10-x86_64-5 ) seems to have ( part of ) the patch included but the problem still occurs. I noticed slackware's patch is:


fix-double-lock-in-inotify-helper-c.patch.gz

Quote:

diff -rupN gamin-0.1.10/server/inotify-helper.c gamin-0.1.10-new/server/inotify-helper.c
--- gamin-0.1.10/server/inotify-helper.c 2008-11-12 21:45:28.000000000 +0100
+++ gamin-0.1.10-new/server/inotify-helper.c 2012-02-02 23:11:47.247757385 +0100
@@ -127,9 +127,6 @@ ih_sub_add (ih_sub_t * sub)
gboolean
ih_sub_cancel (ih_sub_t * sub)
{
- G_LOCK(inotify_lock);
-
-
if (!sub->cancelled)
{
IH_W("cancelling %s\n", sub->pathname);
@@ -140,7 +137,6 @@ ih_sub_cancel (ih_sub_t * sub)
sub_list = g_list_remove (sub_list, sub);
}

- G_UNLOCK(inotify_lock);
return TRUE;
}
But the patch in the above bug report includes an additional section:

Quote:

---
server/inotify-helper.c | 7 ++-----
server/inotify-helper.h | 1 -
2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/server/inotify-helper.c b/server/inotify-helper.c
index d77203e..0789fa4 100644
--- a/server/inotify-helper.c
+++ b/server/inotify-helper.c
@@ -123,13 +123,11 @@ ih_sub_add (ih_sub_t * sub)

/**
* Cancels a subscription which was being monitored.
+ * inotify_lock must be held when calling.
*/
-gboolean
+static gboolean
ih_sub_cancel (ih_sub_t * sub)
{
- G_LOCK(inotify_lock);
-
-
if (!sub->cancelled)
{
IH_W("cancelling %s\n", sub->pathname);
@@ -140,7 +138,6 @@ ih_sub_cancel (ih_sub_t * sub)
sub_list = g_list_remove (sub_list, sub);
}

- G_UNLOCK(inotify_lock);
return TRUE;
}

diff --git a/server/inotify-helper.h b/server/inotify-helper.h
index 5d3b6d0..d36b5fd 100644
--- a/server/inotify-helper.h
+++ b/server/inotify-helper.h
@@ -34,7 +34,6 @@ gboolean ih_startup (event_callback_t ecb,
found_callback_t fcb);
gboolean ih_running (void);
gboolean ih_sub_add (ih_sub_t *sub);
-gboolean ih_sub_cancel (ih_sub_t *sub);

/* Return FALSE from 'f' if the subscription should be cancelled */
void ih_sub_foreach (void *callerdata, gboolean (*f)(ih_sub_t *sub, void *callerdata));
--
1.7.7.2
As you can see, Slackware's patch affects inotify-helper.c only while the above patch affects inotify-helper.c and inotify-helper.h.

Does anyone have experience with this issue? Should I just remove gamin temporarily while I recompile courier ( without fam/gam support )?

Regards, Robby

dijetlo 06-15-2014 07:20 PM

Quote:

IMAP_ENHANCEDIDLE to 1 in /etc/courier/imapd
You might try setting the enhanced idle to 0 (disable it).
Users wont be able to see updates to their mail folders in real time, they'll have to close and re-open to see new mail, however it seems to resolve the locking issue.
I though this might be useful as well.
Quote:

IMAP_USELOCKS

This setting in /etc/courier/imapd must be enabled. This setting uses dot-lock files to synchronize updates to folder indexes between multiple IMAP clients that have the same folder opened.

This setting is safe to use with NFS, as it does not use actual file locking calls, and does not require the services of the problematic NFS lock daemon.
Source

rpedrica 06-19-2014 02:06 AM

Thanks dijetlo,

The default for IMAP_ENHANCEDIDLE is already 0, and USELOCKS is 1. But the issue still happens. I have since rebuilt courier imap with the gamin package removed. The FAMPending errors are gone and no more timeouts. Is gamin really used for anything else? ( KDE? ). Can it not be removed from the distro?

Robby

dijetlo 06-19-2014 12:14 PM

One of the really nice things about Slackware that separates it from other distros is the design groups consideration for existing implementations. There are, no doubt, IMAP servers running gamin with no issues and pulling it out of the distro would make the admins of those machines lives miserable for no good reason.
If we know the solution is to move to FAM for heavier traffic servers, it's probably just better we help each other out and share it.
Thanks for doing that, BTW, Rob.


All times are GMT -5. The time now is 08:47 PM.