Re: [Dovecot] Dovecot lock problem

2009-11-04 Thread Simon Gao
> >What is the process doing? Check with "strace -p "?
> >How large is the user's mailbox?

We just have another user reporting problem. There is no lock on 
/var/spool/mail/ file. 

The strace has following:

 # strace -p 8117
Process 8117 attached - interrupt to quit
fcntl64(8, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 
0xff9f4db4) = ? ERESTARTSYS (To be restarted)   
  
--- SIGALRM (Alarm clock) @ 0 (0) ---   
 
sigreturn() = ? (mask now [])   
 
time(NULL)  = 1257362101
 
alarm(5)= 0 
 
time(NULL)  = 1257362101
 
fcntl64(8, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 
0xff9f4db4) = ? ERESTARTSYS (To be restarted)   
  
--- SIGALRM (Alarm clock) @ 0 (0) ---   
 
sigreturn() = ? (mask now [])   
 
time(NULL)  = 1257362106
 
alarm(5)= 0 
 
time(NULL)  = 1257362106
 
fcntl64(8, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 
0xff9f4db4) = ? ERESTARTSYS (To be restarted)   
  
--- SIGALRM (Alarm clock) @ 0 (0) ---   
 
sigreturn() = ? (mask now [])   
 
time(NULL)  = 1257362111
 
alarm(5)= 0 
 
time(NULL)  = 1257362111
 
fcntl64(8, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 
0xff9f4db4) = ? ERESTARTSYS (To be restarted)   
  
--- SIGALRM (Alarm clock) @ 0 (0) ---   
 
sigreturn() = ? (mask now [])   
 
time(NULL)  = 1257362116
 
alarm(5)= 0 
 
time(NULL)  = 1257362116
 
fcntl64(8, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 
0xff9f4db4) = ? ERESTARTSYS (To be restarted)   
  
--- SIGALRM (Alarm clock) @ 0 (0) ---   
 
sigreturn() = ? (mask now [])   
 
time(NULL)  = 1257362121
 
alarm(5)= 0 
 
time(NULL)  = 1257362121
 
fcntl64(8, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 
0xff9f4db4) = ? ERESTARTSYS (To be restarted)   
  
--- SIGALRM (Alarm clock) @ 0 (0) ---   
 
sigreturn() = ? (mask now [])   
 
time(NULL)  = 1257362126
 
alarm(5)= 0 
 
time(NULL)  = 1257362126
 
fcntl64(8, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 
0xff9f4db4) = ? ERESTARTSYS (To be restarted)   
  
--- SIGALRM (Alarm clock) @ 0 (0) ---   
 
sigreturn() = ? (mask now [])   
 
time(NULL)  = 1257362131
 
alarm(5)= 0 
 
time(NULL)  = 1257362131
 
fcntl64(8, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 
0xff9f4db4) = ? ERESTARTSYS (To be restarted)   
  
--- SIGALRM (Alarm clock) @ 0 (0) ---   
 
sigreturn() = ? (mask now [])   
 
time(NULL)  = 1257362136
 
alarm(5)= 0 
 
time(NULL)  = 1257362136
 
fcntl64(8, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}, 

Re: [Dovecot] Dovecot lock problem

2009-10-16 Thread Simon Gao
On Friday 16 October 2009 11:04:33 Timo Sirainen wrote:
> On Fri, 2009-10-16 at 10:46 -0700, Simon Gao wrote:
> > On Tue, 2009-10-13 at 11:37 -0700, Simon Gao wrote:
> > > We have a few users experiencing locking problem. When starting
> > > Thunderbird, there is no new emails in Inbox. Dovecot createa a lock
> > > file /var/spool/mail/.lock. It never completes openning Inbox. If
> > > closing the mail client, the open imap session does not get closed, nor
> > > the lock file get deleted.
> > >
> > >What is the process doing? Check with "strace -p "?
> > >How large is the user's mailbox?
> >
> > The size of inbox varies. Some is large, some are only a few hundred KB.
> > If the mailbox is large, it may take time to re-generate index and put
> > lock on inbox file until it's done.  However, it should not for smaller
> > mailbox file.
> 
> Are you using pop3? Do you have pop3_lock_session=yes? Other than that I
> can't think of anything that could keep the lock file for a long time.
> So strace would be helpful.

No. All affected users use imap. This occurred after hard reboot of the imap 
server. 


Re: [Dovecot] Dovecot lock problem

2009-10-16 Thread Timo Sirainen
On Fri, 2009-10-16 at 10:46 -0700, Simon Gao wrote:
> On Tue, 2009-10-13 at 11:37 -0700, Simon Gao wrote:
> > We have a few users experiencing locking problem. When starting 
> > Thunderbird, there is no new emails in Inbox. Dovecot createa a lock file 
> > /var/spool/mail/.lock. It never completes openning Inbox. If closing 
> > the mail client, the open imap session does not get closed, nor the lock 
> > file get deleted.
> 
> >What is the process doing? Check with "strace -p "?
> >How large is the user's mailbox?
> 
> The size of inbox varies. Some is large, some are only a few hundred KB. If 
> the mailbox is large, it may take time to re-generate index and put lock on 
> inbox file until it's done.  However, it should not for smaller mailbox file. 

Are you using pop3? Do you have pop3_lock_session=yes? Other than that I
can't think of anything that could keep the lock file for a long time.
So strace would be helpful.


signature.asc
Description: This is a digitally signed message part


[Dovecot] Dovecot lock problem

2009-10-16 Thread Simon Gao
On Tue, 2009-10-13 at 11:37 -0700, Simon Gao wrote:
> We have a few users experiencing locking problem. When starting 
> Thunderbird, there is no new emails in Inbox. Dovecot createa a lock file 
> /var/spool/mail/.lock. It never completes openning Inbox. If closing 
> the mail client, the open imap session does not get closed, nor the lock 
> file get deleted.

>What is the process doing? Check with "strace -p "?
>How large is the user's mailbox?

The size of inbox varies. Some is large, some are only a few hundred KB. If 
the mailbox is large, it may take time to re-generate index and put lock on 
inbox file until it's done.  However, it should not for smaller mailbox file. 

Deleting index files did not help. The workaround is rename the mailbox file 
and 
copy it to ~/mail folder and let MTA re-create the mailbox. Then let mail 
client subscribes to the new temp mailbox. 

I will try strace next time.

> Here are the errors in log:
> 
> dovecot: Oct 13 11:18:35 Warning: IMAP(user1): Our dotlock file 
> /var/mail/user1.lock was deleted (kept it 88 secs)
> dovecot: Oct 13 11:18:35 Error: IMAP(user1): file_dotlock_delete() 
> failed with mbox file /var/mail/user1: No such file or directory

>I'd guess this is a huge mbox (or your disk I/O is very slow) and
>Dovecot takes a long time trying to read it. mbox_very_dirty_syncs=yes
>may be helpful.

It occurred to mailbox large and small. It should not take very long to read a 
few hundred KB file.




Re: [Dovecot] Dovecot lock problem

2009-10-15 Thread Timo Sirainen
On Tue, 2009-10-13 at 11:37 -0700, Simon Gao wrote:
> We have a few users experiencing locking problem. When starting 
> Thunderbird, there is no new emails in Inbox. Dovecot createa a lock file 
> /var/spool/mail/.lock. It never completes openning Inbox. If closing 
> the mail client, the open imap session does not get closed, nor the lock 
> file get deleted.

What is the process doing? Check with "strace -p "?
How large is the user's mailbox?

> Here are the errors in log:
> 
> dovecot: Oct 13 11:18:35 Warning: IMAP(user1): Our dotlock file 
> /var/mail/user1.lock was deleted (kept it 88 secs)
> dovecot: Oct 13 11:18:35 Error: IMAP(user1): file_dotlock_delete() 
> failed with mbox file /var/mail/user1: No such file or directory

I'd guess this is a huge mbox (or your disk I/O is very slow) and
Dovecot takes a long time trying to read it. mbox_very_dirty_syncs=yes
may be helpful.


signature.asc
Description: This is a digitally signed message part


[Dovecot] Dovecot lock problem

2009-10-13 Thread Simon Gao

Hi,

We have a few users experiencing locking problem. When starting 
Thunderbird, there is no new emails in Inbox. Dovecot createa a lock file 
/var/spool/mail/.lock. It never completes openning Inbox. If closing 
the mail client, the open imap session does not get closed, nor the lock 
file get deleted.


Here are the errors in log:

dovecot: Oct 13 11:18:35 Warning: IMAP(user1): Our dotlock file 
/var/mail/user1.lock was deleted (kept it 88 secs)
dovecot: Oct 13 11:18:35 Error: IMAP(user1): file_dotlock_delete() 
failed with mbox file /var/mail/user1: No such file or directory


We are running Dovecot 1.1.2. Any pointer to resolve this problem is 
appreciated.


Simon