vanishing messaging context names
Volker Lendecke
Volker.Lendecke at SerNet.DE
Wed Mar 29 06:26:54 UTC 2017
On Wed, Mar 29, 2017 at 10:53:04AM +1300, Andrew Bartlett via samba-technical wrote:
> I agree. I've been bitten by it before.
>
> In any case, here is a patch. The result of irpc_add_name() is no
> longer removed by talloc_free(), but is removed when the stream or task
> is terminated. In source3 this is left as-was, but it is safe because
> only the notify server registers a name.
In source3/lib/messages_dgm.c we are using a different pattern: There
we store the "owning" pid in the messaging context and only destroy
the socket if the destructor is called by the owning process:
if (getpid() == c->pid) {
....
unlink(name.buf);
}
There is probably not "the canonically perfect" way to do that, but I
think we should agree on a common pattern to handle this problem.
Volker
--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
Samba eXPerience 2017, Hotel Freizeit In
2nd-4th of May 2017, http://sambaXP.org
More information about the samba-technical
mailing list