[Dovecot] mbox locking

Thomas Hummel hummel at pasteur.fr
Mon Jun 26 19:03:39 EEST 2006


Hello, 

I'd like to make sure my understanding of the mbox locking strategy is
correct :

  - "mbox_dotlock_change_timeout" directive :

    a process seeing that an already locked (by another process) mbox
    he want to access hasn't change for this amount of time, allows
    himself to override the lock ? If it's using fcntl, is it only
    possible to override ?

  - when a process abort trying to get a lock after mbox_lock_timeout,
    does the UA sees anything ?

 - multiple locking methods in "mbox_write_lock" :

   if I state, for instance, 

     mbox_write_locks = dotlock fcntl

   when does exactly dotlock method get used and when does fcntl get
   used ?  Are both used simultaneously ?

   Which leads to the wiki's deadlock situation example :

     
     # Program A: fcntl locks the mbox
     # Program B at the same time: dotlocks the mbox
     # Program A continues: tries to dotlock the mbox, but since it's already dotlocked by B, it starts waiting
     # Program B continues: tries to fcntl lock the, but since it's already fcntl locked by A, it starts waiting

  why would A dotlock the mbox since he did fcntl'ed it successfully ?
  if he's able to perform fcntl, he can use a shared or an exclusive
  lock : why use dotlock at all ?

-- 
Thomas Hummel 	    | Institut Pasteur
<hummel at pasteur.fr> | Pôle informatique - systèmes et réseau


More information about the dovecot mailing list