[PATCH] tevent: Do not use uninitialized tv in py_tevent_context_add_timer

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Fri Jan 18 23:23:34 UTC 2019


On 19/01/19 11:26 AM, Douglas Bagnall via samba-technical wrote:

> Looking at this:
> 
> $ git grep add_timer :/*.py
> lib/tevent/bindings.py:        timer = self.ctx.add_timer(0, lambda t: collecting_list.append(True))
> lib/tevent/bindings.py:        timer = self.ctx.add_timer(0, lambda t: collecting_list.append(True))
> lib/tevent/bindings.py:        timer = self.ctx.add_timer(0, lambda t: collecting_list.append(True))
> lib/tevent/bindings.py:        self.ctx.add_timer_offset(0.2, lambda t: collecting_list.append(2))
> lib/tevent/bindings.py:        self.ctx.add_timer_offset(0.1, lambda t: collecting_list.append(1))
> 
> With this patch those last two won't work as expected (rounded to 0 int).
> Currently NONE of them would work as expected, resulting in 0 secs + $RAND usecs.
> 
> It is possible you have just discovered why we have an infinite supply of timing
> related flapping tests, though this is not the first time I have thought that.

I should have looked first. These are leaf node tests, and we don't actually use these
bindings anywhere, which is good I suppose.

Douglas



More information about the samba-technical mailing list