[Samba] Strange locking behaviour upsets Apache

Dave Ewart davee at ceu.ox.ac.uk
Fri Jan 18 10:07:00 GMT 2008


We have a server which runs Samba and Apache.  Web developers edit their
files (via Windows mapped drives) from Windows XP SP2.  These files are
typically CGI files and the developers' routine is:

while (web page not quite right) {
    1. Edit file
    2. Save
    3. Click Reload on web browser
    4. Check results
}

They go around that loop many times during a typical development run.
However, for some staff who are using the editor Visual Slick Edit, we
have a problem at Step 3.  The web server returns a "500 Internal Server
Error" message.  However, if one waits approximately 10-15 seconds and
clicks Reload again, the web page loads as expected.

At the same time as the '500 Internal Server Error' is sent to the
browser, the following appears in the Apache logs:

    [error] (26)Text file busy: exec of
    /home/user/public_html/blah/blah.cgi failed
 
"Text file busy" is the key.  If one runs 'smbstatus | grep epic_plasma'
(in this case) and watches the locks shown for the file being edited, a
lock is seen:

    28434 1165 DENY_WRITE 0x2019f RDWR EXCLUSIVE+BATCH
    /home/user/public_html/blah/blah.cgi [...]

Upon repeated re-running of 'smbstatus', the above lock goes away after
approximately 10-15 seconds.

Apache refuses to attempt loading the CGI file if the Samba lock is in
place, it seems.  This delay makes it very disruptive to the developers.

This problem arose following our upgrade from Debian/Sarge to
Debian/Etch, without changing smb.conf.  The problem is limited to staff
using the Visual Slick Edit editor (which may indeed be the source of
the problem, but I want to understand what Samba is doing).  Staff
using, say, gVim are unaffected.

I've read the changelog for Samba for the versions between the
Debian/Sarge release and that for Debian/Etch and I don't see anything
which relates to locking behaviour.

The Samba configuration for the share on which the files in question
reside contains no lock-related parameters.

It may be useful to compare the behaviour of Slick Edit and, say, gVim:

SlickEdit: 

- "DENY_WRITE RDONLY EXCLUSIVE+BATCH" lock appears for around 10-15
  second when the file is *opened*;
- "DENY_WRITE RDWR EXCLUSIVE+BATCH" lock appears for around 10-15
  seconds following each *save*;

gVim:

- "RD_ONLY DENY_NONE" appears on the file *very* briefly (less than a
second) at the time the file is *opened*;
- I haven't observed any other locks on the file during save;

Does anyone have any suggestions for what I can try here?

Dave.


-- 
Dave Ewart
davee at ceu.ox.ac.uk
Computing Manager, Cancer Epidemiology Unit
University of Oxford / Cancer Research UK
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/samba/attachments/20080118/04f594e1/attachment.bin


More information about the samba mailing list