[ovs-dev] [PATCH 2/2] unixctl: New JSON RPC back-end.

Ben Pfaff blp at nicira.com
Mon Feb 27 22:56:29 UTC 2012


On Mon, Feb 27, 2012 at 02:04:54PM -0800, Ethan Jackson wrote:
> > I would argue that run_connection() should only read a new request
> > if the connection is not backlogged (this is already tested in
> > unixctl_server_wait() so maybe that was your intention all along?).
> >
> > I don't think that run_connection() really needs a loop.  One try
> > should be enough.  (I think I must have overthought the logic in
> > there.)  Ditto for the loop around pstream_accept() in
> > unixctl_server_run().
> 
> I'm not sure I agree with this entirely.  What if a client sends
> multiple requests in a row very quickly.  Doesn't it make sense to
> process all of them at once in a single run loop instead of having to
> go through an entire run loop per request?  I suppose the problem with
> the current code is that a client could arbitrarily fill the server's
> backlog by sending lots of requests.  It certainly would be easiest to
> deal with this by not processing requests until the backlog is empty.
> Alternatively we could set a maximum on the backlog and not process
> requests when that value is hit.  I'm not sure what the correct thing
> to do is, do you have thoughts?

I was suggesting an optional simplification.  Obviously when I wrote
the existing code I had the idea of back-to-back requests in mind, or
I wouldn't have written it that way.  But the only existing client
only sends a single request per program execution, so multiple
back-to-back requests just isn't an important case.

The existing code is also fine, if you prefer it.



More information about the dev mailing list