Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1742305 Details for
Bug 1911113
uw-imapd not well suited for the roundcube webmailer
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to imapd-2007f to enhance robustness for the situation, the mailbox is locked
imap-2007f-lockretry.patch (text/plain), 6.59 KB, created by
Albert Flügel
on 2020-12-27 16:08:00 UTC
(
hide
)
Description:
Patch to imapd-2007f to enhance robustness for the situation, the mailbox is locked
Filename:
MIME Type:
Creator:
Albert Flügel
Created:
2020-12-27 16:08:00 UTC
Size:
6.59 KB
patch
obsolete
>diff -ru imap-2007a/docs/FAQ.html imap-2007af/docs/FAQ.html >--- imap-2007a/docs/FAQ.html 2011-07-23 02:20:21.000000000 +0200 >+++ imap-2007af/docs/FAQ.html 2020-12-27 16:27:32.012285692 +0100 >@@ -3404,6 +3404,27 @@ > <p>The solution to both situations is to replace the client with a good > online IMAP client such as Pine. Life is too short to waste on POP > clients and poorly-designed IMAP clients.</p> >+ >+ <p>However, the unix version is a bit more tolerant. When the >+ server detects, that a lock is set on the mailbox, it retries >+ to obtain it until 15 seconds after the creation time of the >+ lock, if the lock is not already that old. Only after this >+ phase of retrying it sends the "kiss of death" to the competing >+ process. This way the scenarios outlined above and the related >+ errors probably displayed to the users are mostly avoided. A >+ short concurrent access e.g. to check for new mail should not >+ cause some kind of outage and confuse the users. On the other >+ side, a short waiting time for the lock to be released should >+ be acceptable. A particular experience was using the web mailer >+ "roundcube" (please see http://roundcube.net/ ). It is closing >+ imap connections by only fractions of a second after opening >+ another one yet causing this imap server to detect an existing >+ lock and requesting the termination of another server instance, >+ what makes roundcube assume something went wrong. Probably this >+ shortly later closing of connections is actually a matter of >+ deferred execution in the browser, who is the actual client of >+ roundcube in turn, so this phenomenon is probably (unclear) not >+ even a fault of the roundcube implementation. > </dd> > </dl> > >diff -ru imap-2007a/docs/FAQ.txt imap-2007af/docs/FAQ.txt >--- imap-2007a/docs/FAQ.txt 2011-07-23 02:20:20.000000000 +0200 >+++ imap-2007af/docs/FAQ.txt 2020-12-27 16:24:52.166735194 +0100 >@@ -2366,6 +2366,27 @@ > The solution to both situations is to replace the client with a > good online IMAP client such as Pine. Life is too short to > waste on POP clients and poorly-designed IMAP clients. >+ >+ However, the unix version is a bit more tolerant. When the >+ server detects, that a lock is set on the mailbox, it retries >+ to obtain it until 15 seconds after the creation time of the >+ lock, if the lock is not already that old. Only after this >+ phase of retrying it sends the "kiss of death" to the competing >+ process. This way the scenarios outlined above and the related >+ errors probably displayed to the users are mostly avoided. A >+ short concurrent access e.g. to check for new mail should not >+ cause some kind of outage and confuse the users. On the other >+ side, a short waiting time for the lock to be released should >+ be acceptable. A particular experience was using the web mailer >+ "roundcube" (please see http://roundcube.net/ ). It is closing >+ imap connections by only fractions of a second after opening >+ another one yet causing this imap server to detect an existing >+ lock and requesting the termination of another server instance, >+ what makes roundcube assume something went wrong. Probably this >+ shortly later closing of connections is actually a matter of >+ deferred execution in the browser, who is the actual client of >+ roundcube in turn, so this phenomenon is probably (unclear) not >+ even a fault of the roundcube implementation. > _________________________________________________________________ > > 7.20 Why does my IMAP client show all the files on the system, >diff -ru imap-2007a/src/osdep/unix/unix.c imap-2007af/src/osdep/unix/unix.c >--- imap-2007a/src/osdep/unix/unix.c 2011-07-23 02:20:10.000000000 +0200 >+++ imap-2007af/src/osdep/unix/unix.c 2020-12-27 16:33:27.968369879 +0100 >@@ -458,10 +458,14 @@ > int fd; > char tmp[MAILTMPLEN]; > DOTLOCK lock; >- long retry; >+ int kodretry; >+ struct stat sbuf; >+ time_t lock_timeo; > /* return prototype for OP_PROTOTYPE call */ > if (!stream) return user_flags (&unixproto); >- retry = stream->silent ? 1 : KODRETRY; >+ kodretry = stream->silent ? 1 : KODRETRY; >+ lock_timeo = time((time_t *) 0) + kodretry; /* timeout for lock retries */ >+ sbuf.st_mtime = (time_t) 0; /* to determine lock age from file */ > if (stream->local) fatal ("unix recycle stream"); > stream->local = memset (fs_get (sizeof (UNIXLOCAL)),0,sizeof (UNIXLOCAL)); > /* note if an INBOX or not */ >@@ -486,22 +490,42 @@ > stream->sequence++; /* bump sequence number */ > > /* make lock for read/write access */ >- if (!stream->rdonly) while (retry) { >+ if (!stream->rdonly) while (kodretry > 0 || lock_timeo >= time ((time_t) 0)) { > /* try to lock file */ > if ((fd = lockname (tmp,stream->mailbox,LOCK_EX|LOCK_NB,&i)) < 0) { >+ if (! sbuf.st_mtime) { >+ if (! stat (tmp,&sbuf)) { /* adapt lock retry timeout */ >+ if (time ((time_t) 0) >= sbuf.st_mtime) lock_timeo = sbuf.st_mtime + (stream->silent ? 1 : KODRETRY); >+ } >+ else sbuf.st_mtime = (time_t) 1; >+ } >+ /* re-try to obtain lock until timeout */ >+ if (lock_timeo >= time ((time_t) 0)) { >+ if (!stream->silent) { >+ if (lock_timeo >= time ((time_t) 0)) { >+ struct timespec ts; >+ ts.tv_sec = 0; >+ ts.tv_nsec = 350000000; >+ nanosleep (&ts, (struct timespec *) 0); >+ } >+ else MM_LOG ("Mailbox is open by another process, sending kiss of death", >+ WARN); >+ } >+ continue; >+ } > /* suppressing kiss-of-death? */ >- if (stream->nokod) retry = 0; >+ if (stream->nokod) kodretry = 0; > /* no, first time through? */ >- else if (retry-- == KODRETRY) { >+ else if (kodretry-- == KODRETRY) { > /* learned other guy's PID and can signal? */ > if (i && !kill ((int) i,SIGUSR2)) { > sprintf (tmp,"Trying to get mailbox lock from process %ld",i); > MM_LOG (tmp,WARN); > } >- else retry = 0; /* give up */ >+ else kodretry = 0; /* give up */ > } > if (!stream->silent) { /* nothing if silent stream */ >- if (retry) sleep (1); /* wait a second before trying again */ >+ if (kodretry) sleep (1); /* wait a second before trying again */ > else MM_LOG ("Mailbox is open by another process, access is readonly", > WARN); > } >@@ -518,7 +542,8 @@ > } > ftruncate (fd,i); /* make sure tied off */ > fsync (fd); /* make sure it's available */ >- retry = 0; /* no more need to try */ >+ kodretry = 0; /* no more need to try */ >+ lock_timeo = (time_t) 0; > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1911113
: 1742305 |
1742307
|
1742726