[PATCH] Cache messaging dgm connections
Ralph Böhme
slow at samba.org
Thu Sep 15 09:06:00 UTC 2016
Wed, Sep 14, 2016 at 10:13:13PM -0700, Jeremy Allison wrote:
> My money is on the event context getting freed with
> active connections. I'm cheating here as this is
> something metze already discovered with Volker's
> tmsgd work :-).
>
> Metze's patch for this is attached (modified to
> compile in master). I'm trying a private autobuild
> with it now.
I guess we also need this:
--- a/lib/poll_funcs/poll_funcs_tevent.c
+++ b/lib/poll_funcs/poll_funcs_tevent.c
@@ -474,6 +474,7 @@ struct poll_funcs *poll_funcs_init_tevent(TALLOC_CTX *mem_ctx)
static int poll_funcs_state_destructor(struct poll_funcs_state *state)
{
size_t num_watches = talloc_array_length(state->watches);
+ size_t num_timeouts = talloc_array_length(state->timeouts);
size_t i;
/*
* Make sure the watches are cleared before the contexts. The watches
@@ -482,6 +483,9 @@ static int poll_funcs_state_destructor(struct poll_funcs_state *state)
for (i=0; i<num_watches; i++) {
TALLOC_FREE(state->watches[i]);
}
+ for (i=0; i<num_timeouts; i++) {
+ TALLOC_FREE(state->timeouts[i]);
+ }
return 0;
}
but afaict all this will still crash if the tevent context is freed
before we have a chance to rundown the messaging and poll_funcs
contexts.
Cheerio!
-slow
More information about the samba-technical
mailing list