Bug 20206 - Lost Mailbox Lock in IMAP
Summary: Lost Mailbox Lock in IMAP
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: imap
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Dale Lovelace
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-02 13:47 UTC by Frank Baier
Modified: 2007-04-18 16:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-11-07 16:56:21 UTC
Embargoed:


Attachments (Terms of Use)

Description Frank Baier 2000-11-02 13:47:51 UTC
The Imap Server get the following Message in the Logfile:
Nov  2 14:43:55 brain imapd[2698]: imap service init from 192.168.128.111
Nov  2 14:43:55 brain imapd[2698]: Login user=fbaier host=ws1.wallace.de 
[192.168.128.111]
Nov  2 14:43:55 brain imapd[2697]: Killed (lost mailbox lock) user=fbaier 
host=ws1.wallace.de [192.168.128.111]
Nov  2 14:43:56 brain imapd[2697]: Logout user=fbaier host=ws1.wallace.de 
[192.168.128.111]

I'll this  error Message at Outlook Express and the maillog Logfile only 
at the first access, when I start Outlook Express. The I can browse 
through my Mailbox.

Comment 1 Nalin Dahyabhai 2000-11-02 21:57:08 UTC
Are you accessing the same mailbox concurrently using multiple client sessions?

Comment 2 Nalin Dahyabhai 2000-11-03 17:12:05 UTC
Per private email:
> > Please do not reply directly to this email. All additional
> > comments should be made in the comments box of this bug report.
> No.
> I have only one Workstation connected to the network and only one account
> for this Mailbox. I  haven't had this problem before (RH6.1) and no changes
> where made at the workstation.

It certainly appears that there was already a connection open to the IMAP
server.  When you made a second connection (process 2698), the first (process
2697) one was killed.  If you didn't have more than one copy of Outlook Express
open, then it's the client that's causing this error and there's not much we can
do about it from the server side.

Comment 3 Jason Tibbitts 2000-11-07 15:59:40 UTC
I'm seeing basically the same problem, with Outlook 2000 as the client.

What we're seeing is large numbers of imap process hanging around, owned by the
same user.  It seems as if Outlook is opening multiple connections, but the imap
processes hang around even after Outlook has exited.  Some even sit in the D
state.  Some are sitting in select, while some will exit immediately after I
attempt to strace them.  At the end is a process list and a snippet of maillog
(sorry about the line wrapping).

A very important detail is that this problem didn't exist before I upgraded from
6.2 to 7.0.  Also important is that this user has a 48MB mail spool, and the
spool is accessed over NFS.  (And without imap working properly, it's tough for
this user to pare that down.)

100 D jennifer 26685 23250  0  60   0    -  1059 end    Nov06 ?        00:00:00
imapd
100 S jennifer 26843 23250  0  60   0    -  1059 end    Nov06 ?        00:00:00
imapd
100 S jennifer 26873 23250  0  60   0    -  1059 end    Nov06 ?        00:00:00
imapd
100 S jennifer 26902 23250  0  60   0    -  1059 end    Nov06 ?        00:00:00
imapd
100 S jennifer 26943 23250  0  60   0    -  1059 end    Nov06 ?        00:00:00
imapd
100 S jennifer 27338 23250  0  60   0    -  1128 end    Nov06 ?        00:00:24
imapd
100 D jennifer 27866 23250  0  60   0    -  1059 end    Nov06 ?        00:00:00
imapd
100 S jennifer  2943 23250  0  60   0    -  1059 end    09:22 ?        00:00:00
imapd
100 S jennifer  3073 23250  0  60   0    -  1059 end    09:33 ?        00:00:00
imapd
100 S jennifer  3115 23250  0  60   0    -  1059 end    09:34 ?        00:00:00
imapd


Nov  7 09:22:11 ilnea imapd[2940]: imap service init from 129.7.128.66
Nov  7 09:22:11 ilnea imapd[2940]: Login user=jennifer host=sisko.math.uh.edu
[129.7.128.66]
Nov  7 09:22:28 ilnea imapd[2943]: imap service init from 129.7.128.66
Nov  7 09:22:28 ilnea imapd[2943]: Login user=jennifer host=sisko.math.uh.edu
[129.7.128.66]
Nov  7 09:33:05 ilnea imapd[3071]: imap service init from 129.7.128.66
Nov  7 09:33:05 ilnea imapd[3071]: Login user=jennifer host=sisko.math.uh.edu
[129.7.128.66]
Nov  7 09:33:07 ilnea imapd[2940]: Killed (lost mailbox lock) user=jennifer
host=sisko.math.uh.edu [129.7.128.66]
Nov  7 09:33:12 ilnea imapd[3073]: imap service init from 129.7.128.66
Nov  7 09:33:12 ilnea imapd[3073]: Login user=jennifer host=sisko.math.uh.edu
[129.7.128.66]
Nov  7 09:34:28 ilnea imapd[3071]: Command stream end of file, while reading
line user=jennifer host=sisko.math.uh.edu [129.7.128.66]
Nov  7 09:34:46 ilnea imapd[3083]: imap service init from 129.7.128.66
Nov  7 09:34:46 ilnea imapd[3083]: Login user=jennifer host=sisko.math.uh.edu
[129.7.128.66]
Nov  7 09:34:48 ilnea imapd[3115]: imap service init from 129.7.128.66
Nov  7 09:34:48 ilnea imapd[3115]: Login user=jennifer host=sisko.math.uh.edu
[129.7.128.66]
Nov  7 09:37:45 ilnea imapd[3083]: Command stream end of file, while reading
line user=jennifer host=sisko.math.uh.edu [129.7.128.66]


Comment 4 Frank Baier 2000-11-07 16:56:17 UTC
This is a problem with Outlook Express!!!
Outlook Express will look for new mail and syncing the IMAP folders in 
different threads!!! So the new IMAP server will lost the looking!!!
Disable the Syncing for all Imap Folders and looking for new Mail in all 
Folders and it works well!!!

bye
Frank

Comment 5 Jason Tibbitts 2000-11-07 18:12:09 UTC
Is my guess that an updated package will be released correct?  (I'm not exactly
sure what "Resolution: ERRATA" means.)  Can someone fill me in on what the
actual problem is and when I'll be able to grab a package (even a non QA'd one
for testing)?  I'm trying to take care of a rather irate user who has lost all
access to her mail.

Thanks!


Comment 6 Frank Baier 2000-11-07 18:18:49 UTC
It isn't a server problem!! you dont need a Update it's a problem between OE 
and IMAPD. OE uses one Account in different threads at the sam time. The 
workaround is tu deactivate the syncronicing between OE and the linux box in 
the configuration in OE. OE will work well without sync.


Comment 7 Jason Tibbitts 2000-11-07 18:32:00 UTC
You keep saying that it isn't a server problem, but when I have 20 stuck imap
daemons all hanging onto locks long after the client has been shut down, I think
that there's a good possibility of it being a server problem.  Also, why did
this not fail two days ago when I had yet to upgrade from 6.2. to 7.0?

Besides, the Red Hat engineer resolved it ERRATA instead of NOTABUG or WONTFIX,
so it seems likely that they'll issue some kind of fix.


Comment 8 Jason Tibbitts 2000-11-10 16:50:50 UTC
For the benefit of those that might search for this, I've found my problem.  The
user's home directory was NFS mounted from an old Sun running an old version of
Solaris which does not support NFS file locking.  The imapd in 6.2 had no
problem with this, but the one in 7.0 and current rawhide does.  Moving the
user's home directory onto a machine with a modern OS solved the problem.


Comment 9 Gabriele Turchi 2000-11-16 11:32:06 UTC
My configuration: imapd on RedHat 7.0 server, mailboxes on local disk. Clients
using mutt/balsa 1.0/netscape for reading INBOX. Some clients are using the
gnome applet for checking IMAP mailbox. When the applet test the mailbox the
other client eventually connected receive the "Lost Mailbox Lock". With older
imapd, when more than one client requested access to a mailbox, only the first
can write, others are accepted as read-only. Now the latest request is accepted,
others are "kicked-off". That's a server problem from my point of view.

bye,
	Gabriele Turchi

P.S.: my english is always in alpha version...

Comment 10 Gabriele Turchi 2000-11-17 10:06:41 UTC
After a better reading og imap-2000 code I've found the "problem". In that
version when a client connects and another client is already connected, the
server send a "kiss of death" (SIGUSR2) to the connected one. Strange
behaviour... like "jungle law". Here enclosed my "very quick and dirty" patch to
revert the behaviour to old one.

bye,
	Gabriele Turchi

---------------8<----------------8<------------------8<----------------
--- src/osdep/unix/unix.c.ori   Thu Nov 16 14:25:55 2000
+++ src/osdep/unix/unix.c       Thu Nov 16 14:29:32 2000
@@ -366,17 +366,9 @@
   if (!stream->rdonly) while (retry) {
                                /* try to lock file */
     if ((fd = lockname (tmp,stream->mailbox,LOCK_EX|LOCK_NB,&i)) < 0) {
-      if (retry-- == KODRETRY) {/* no, first time through? */
-       if (i) {                /* learned the other guy's PID? */
-         kill ((int) i,SIGUSR2);
-         sprintf (tmp,"Trying to get mailbox lock from process %ld",i);
-         mm_log (tmp,WARN);
-       }
-       else retry = 0;         /* give up */
-      }
       if (!stream->silent) {   /* nothing if silent stream */
-       if (retry) sleep (1);   /* wait a second before trying again */
-       else mm_log ("Mailbox is open by another process, access is readonly",
+       retry = 0;
+       mm_log ("Mailbox is open by another process, access is readonly",
                     WARN);
       }
     }
-------------------------8<------------------8<----------------------


Note You need to log in before you can comment on or make changes to this bug.