[PATCH] Improve code in ctdb lock helper
jra at samba.org
Thu Dec 1 17:06:31 UTC 2016
On Thu, Dec 01, 2016 at 10:47:06AM +0100, Volker Lendecke wrote:
> On Thu, Dec 01, 2016 at 03:33:09PM +1100, Amitay Isaacs wrote:
> > Hi,
> > Here are two patches that do the following:
> > 1. Drop the support for locking multiple databases since it's not required
> > any more.
> > 2. Add explicit unlocking of record/db when lock helper is exiting
> Are we sure that we only ever call async signal safe functions in the
> tdb functions? For example I'm pretty certain that tdb_close calls
> free(), which is not async signal safe. What happens for example if
> the signal comes before we expect it, and we are in a malloc call?
> This would block the child forever.
> Can we change this to not call tdb functions directly in the signal
> handler but set a global variable, expecting EINTR at all relevant
Oh god yes. The list of things you can do inside a signal
handler is vanishingly small, and tdb calls are certainly
not on that list.
More information about the samba-technical