[PATCH] Fix vanishing messaging context names

Jeremy Allison jra at samba.org
Wed Mar 29 18:17:08 UTC 2017


On Wed, Mar 29, 2017 at 08:58:59AM -0700, Jeremy Allison via samba-technical wrote:
> > > inside the bin/samba binary for forked tasks. Otherwise we
> > > will forever be fighting this inside source4-forked children.
> > > 
> > > I'd rather bite the bullet and fix this properly for all
> > > time now :-).
> > 
> > Patches welcome, but we have multiple messaging contexts in source4, so
> > it isn't as simple.  In the meantime, I don't like DB or filesystem
> 
> After a fork all messaging contexts need to
> be reset, otherwise you are guarenteed to have problems
> like the one I'm tracking now.
> 
> > modification in a talloc destructor (see the earlier, rejected,
> > proposal for a talloc_free_for_exit()), which is why I propose this
> > patch.
> > 
> > To be clear, this part of a series to try and make multi-process LDAP
> > sane, because I've had a number of our user say they are bleeding on
> > this when they hook Zarafa (a mail server) up to Samba.
> 
> If we fix this properly in the process-model code (after we fork),
> then we should be able to remove the problem from any other
> services we later move to multi-process.

OK, here is what I think is a better fix as it's addressing
the root cause, not doing bandaids. This should also fix your
multi-process LDAP issue.

Essentially after a fork() we must re-init the list of imessaging
contexts to stop the child process removing names registered by
its parent. I've added this just after the ldb_wrap_fork_hook() call,
where we take care of the same issue for tdb handles. It's also
similar to what we do inside the s3 reinit_after_fork() code.

Volker, can you take a look and see that I got the modification
of server_id right in the reinit code ?

Please review and push if happy.

This passes 'make test TESTS=samba.tests.samba_tool'.

If I revert a47a8e41bd3acc20d40ba78449d89775bcdd73ed it still
passes, although that commit removes the knownfail below:

diff --git a/selftest/knownfail b/selftest/knownfail
index 1657ff3ff22..b25038064c3 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -319,4 +319,3 @@
 ^samba3.smb2.credits.skipped_mid.*
 ^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.dangling_multi_valued_dbcheck
 ^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.dangling_multi_valued_check_missing
-^samba.tests.samba_tool.processes.samba.tests.samba_tool.processes.ProcessCmdTestCase.test_unknown_name\(ad_dc_ntvfs:local\)

What should be the behavior of:

samba-tool processes --name no-such-name

Should we just print nothing if the name isn't
in the db, or error out ? With the current code
in master we just print nothing and ignore an
unknown name.

Jeremy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s4-messaging.-Add-imessaging_reinit_all-function.patch
Type: text/x-diff
Size: 3681 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170329/f8b6653b/0001-s4-messaging.-Add-imessaging_reinit_all-function.diff>


More information about the samba-technical mailing list