[Samba] Strange locking behaviour upsets Apache - Samba
This is a discussion on [Samba] Strange locking behaviour upsets Apache - Samba ; 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) {
...
-
[Samba] Strange locking behaviour upsets Apache
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@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
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFHkHpEbpQs/WlN43ARAmdjAJwJ2XW9vj5Bq8fr0XoS+PhIYIjAqQCgvYtA
5D9g1vpGMXmrscFOPrLcXcE=
=3/cH
-----END PGP SIGNATURE-----
-
Re: [Samba] Strange locking behaviour upsets Apache
On Fri, Jan 18, 2008 at 10:07:00AM +0000, Dave Ewart wrote:
> 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 [...]
Try using "oplocks = no". Be aware though that this has
performance implications.
Volker
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFHkIOBUzqjrWwMRl0RAuFCAJ9FGi+2Iwx15L8c2wBUFG V2I8cn3gCfegrK
ilOBGztV0cqj8Vnrlta7NJI=
=hyzG
-----END PGP SIGNATURE-----
-
Re: [Samba] Strange locking behaviour upsets Apache
On Friday, 18.01.2008 at 11:46 +0100, Volker Lendecke wrote:
> On Fri, Jan 18, 2008 at 10:07:00AM +0000, Dave Ewart wrote:
> > 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 [...]
>
> Try using "oplocks = no". Be aware though that this has performance
> implications.
Hmmm, reading about the performance implications, I'm not sure that I'm
enthusiastic about trying it, really.
Can you explain what's actually going on in the above problem, please?
Is the Windows editor doing something wrong/unhelpful in generating the
lock? Or is it simply taking advantage of behaviour which is allowed by
Samba? Specifically, why does the lock take 10-15 seconds to go away?
Dave.
--
Dave Ewart
davee@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
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFHkKY2bpQs/WlN43ARAgecAKC9fy1eHyTRNxH5xrltSe/m/h4mGACfbkBq
EVNb/SyfAyW/9e+7mvCcbOM=
=SmqZ
-----END PGP SIGNATURE-----
-
Re: [Samba] Strange locking behaviour upsets Apache
On Fri, Jan 18, 2008 at 01:14:30PM +0000, Dave Ewart wrote:
> Can you explain what's actually going on in the above problem, please?
> Is the Windows editor doing something wrong/unhelpful in generating the
> lock? Or is it simply taking advantage of behaviour which is allowed by
> Samba? Specifically, why does the lock take 10-15 seconds to go away?
It's the Windows redirectory that might hold the file open
longer than the app does it.
BTW, what is your server platform? With Linux and activated
kernel oplock this should not happen.
Volker
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFHkK9qUzqjrWwMRl0RAueKAJ9/T8EDBnRaLTS3Lu1842HT5OKYhQCghyXF
PEUiNbLioIpmPO0/j48k0tc=
=k2ZD
-----END PGP SIGNATURE-----
-
Re: [Samba] Strange locking behaviour upsets Apache
On Friday, 18.01.2008 at 14:53 +0100, Volker Lendecke wrote:
> On Fri, Jan 18, 2008 at 01:14:30PM +0000, Dave Ewart wrote:
> > Can you explain what's actually going on in the above problem, please?
> > Is the Windows editor doing something wrong/unhelpful in generating the
> > lock? Or is it simply taking advantage of behaviour which is allowed by
> > Samba? Specifically, why does the lock take 10-15 seconds to go away?
>
> It's the Windows redirectory that might hold the file open
> longer than the app does it.
What is "Windows redirectory"?
> BTW, what is your server platform? With Linux and activated
> kernel oplock this should not happen.
Server is Debian/Etch/amd64, but with a slightly newer-than-Etch kernel
for hardware support: 2.6.22.
Dave.
--
Dave Ewart
davee@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
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFHkLNgbpQs/WlN43ARAt4+AKC3UrpN0sp2dS6unppLikrjiGCrzwCg/dpe
U2Yv6/A1pNot03ysPhzydmc=
=j4o+
-----END PGP SIGNATURE-----
-
Re: [Samba] Strange locking behaviour upsets Apache
On Fri, Jan 18, 2008 at 02:10:40PM +0000, Dave Ewart wrote:
> > It's the Windows redirectory that might hold the file open
> > longer than the app does it.
>
> What is "Windows redirectory"?
Sorry, "Windows Redirector". It is the system component in a
Windows client operating system that redirects your drive d:
to a SMB share that resides on a file server.
> > BTW, what is your server platform? With Linux and activated
> > kernel oplock this should not happen.
>
> Server is Debian/Etch/amd64, but with a slightly newer-than-Etch kernel
> for hardware support: 2.6.22.
Hmm. This *should* work fine if you have not explicitly
disabled kernel oplocks in your smb.conf.
You might still try "oplocks = no". If you are not able to
do this, then I can't help you any further.
Sorry,
Volker
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFHkLZOUzqjrWwMRl0RArwoAJ9oA3M5j/M6OxB8JDkyb0RyFgXSvgCfVwgn
xBVpIkbY0QQxGKfRaVMhbS0=
=RsaS
-----END PGP SIGNATURE-----
-
Re: [Samba] Strange locking behaviour upsets Apache
On Friday, 18.01.2008 at 15:23 +0100, Volker Lendecke wrote:
> On Fri, Jan 18, 2008 at 02:10:40PM +0000, Dave Ewart wrote:
> > > It's the Windows redirectory that might hold the file open longer
> > > than the app does it.
> >
> > What is "Windows redirectory"?
>
> Sorry, "Windows Redirector". It is the system component in a Windows
> client operating system that redirects your drive d: to a SMB share
> that resides on a file server.
Ah, thanks.
> > > BTW, what is your server platform? With Linux and activated kernel
> > > oplock this should not happen.
> >
> > Server is Debian/Etch/amd64, but with a slightly newer-than-Etch
> > kernel for hardware support: 2.6.22.
>
> Hmm. This *should* work fine if you have not explicitly disabled
> kernel oplocks in your smb.conf.
>
> You might still try "oplocks = no". If you are not able to do this,
> then I can't help you any further.
Thanks for the info, Volker; much appreciated.
I will investigate our options...
Cheers,
Dave.
--
Dave Ewart
davee@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
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFHkMaTbpQs/WlN43ARAgq2AJ4kXv4hMy9PA0fT7IM12IvswV1weACgotlg
8PH58cdmsG1Qjb7j9PWTlPQ=
=s3/1
-----END PGP SIGNATURE-----