Messaging patches

Jeremy Allison jra at samba.org
Tue Apr 29 13:58:51 MDT 2014


On Tue, Apr 29, 2014 at 05:03:22PM +0200, Volker Lendecke wrote:
> Hi!
> 
> Attached find a few patches for messaging3, one critical
> bugfix (I believe). Right now autobuild is pretty flaky for
> me, so I could not successfully run this through autobuild
> yet. It does survive some simple tests for me though.

I just spent 3 hours reading and re-reading this code :-).

The point of the extra :

+       struct tevent_req **new_waiters;
+       unsigned num_new_waiters;

staging array took me a *long* time to understand.
I originally thought we could do without them by
forcing messaging_dispatch_rec() to do a second
pass over the:

        struct tevent_req **waiters;
        unsigned num_waiters;

array, dispatching the messages via messaging_read_done()
in the first pass, and then removing all NULL entries
in the second pass.

Then I finally realized that calling messaging_read_done()
in the first pass could also modify waiters and num_waiters
if the callback function called messaging_read_send(), so
the staging array is the only safe way to do this.

Phew.... :-).

Gonna try pushing to autobuild. Wish me luck ! :-).

Jeremy.


More information about the samba-technical mailing list