[PATCHES] Fix smbd open race and render defer_open test less flakey

Michael Adam obnox at samba.org
Wed Sep 10 05:57:44 MDT 2014


Hi,

The defer_open test is currently one of the most frequent
causes of autobuild failure.

I have just brought a few patches upstream (reviewed by Metze)
that correct the defer_open test to reliably produce
toreture-compatible "failure" instead of  "error"
if something goes wrong.
(These reason for this was in the missing tracking of
child process status in the test wrapper not in the
test itself, so this might also have positive effects
on a few other tests.)

Now these changes gave me the opportunity to finally
start analyzing what is going on.
There are two causes of failure which I frequently saw:

1. return code OBJECT_NAME_NOT FOUND  for the create call.
2. reply with SHARING_VIOLATION took too long

The first is due to a race in open_file() which I
fixed in the other attached patch: The file vanished
between check for existence and the acl check.
==> review/push/comments appreciated.

The second I have watered down by increasing the
absolute (not-scaled) generosity from 1 second to 1.5 seconds
in the test case.
==> patch attached.

These patches allowed me to run the defer_open test successfully
for several hundred times in a row on our autobuild-host!
(Previously it failed reliably on that machine before it reached 10.)

I just observed a third failure:
create results in NT_STATUS_ACCESS_DENIED.
I suspect that there is another race in the open code.
I will investigate further, but this seems to be very rare.

Cheers - Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-smbd-fix-a-race-in-open-code.patch
Type: text/x-diff
Size: 2548 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140910/2ffe03d3/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-s4-torture-base-slightly-more-generous-timing-in-the.patch
Type: text/x-diff
Size: 1197 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140910/2ffe03d3/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140910/2ffe03d3/attachment-0001.pgp>


More information about the samba-technical mailing list