[ovs-dev] [PATCH 2/2] debian: Add support for GRE-over-IPsec

Ben Pfaff blp at nicira.com
Thu Sep 23 18:03:38 UTC 2010


On Wed, Sep 22, 2010 at 10:49:27PM -0700, Justin Pettit wrote:
> On Sep 22, 2010, at 11:42 AM, Ben Pfaff wrote:
> > IPsec.call_setkey() seems ripe for deadlock, if setkey blocks waiting
> > for its output to stdout to finish, while ovs-monitor-ipsec blocks
> > waiting to feed input to its stdin.  I assume that's why communicate()
> > takes an input string as argument: so that it can interleave reads and
> > writes, resolving deadlock.  So I would change
> >        p.stdin.write(cmds)
> >        out = p.communicate()[0]
> > to
> >        out = p.communicate(cmds)[0]
> > to avoid the problem.
> 
> Yes, I was aware of this, but I couldn't get this to work on slightly
> longer commands.  Reid and I both spent some time trying to figure out
> what was going on, but without much luck.  We think it's likely due to
> an issue in the order in which communicate attempts to handle "ready"
> file descriptors.  I'm pushing this as-is, since the amount we write
> to stdin is always relatively small.  I will look into finding an
> alternative when I work on adding certificate support over the next
> couple of days.

Hmm, that's odd.  I looked over the "communicate" implementation for
Python 2.5 and it looked reasonable on the surface.  Bizarre.




More information about the dev mailing list