[libvirt] [PATCH] Don't sleep in poll() if there is existing SASL decoded data

Eric Blake eblake at redhat.com
Tue Feb 1 16:18:45 UTC 2011


On 02/01/2011 09:09 AM, Daniel P. Berrange wrote:
> In the SASL codepath we typically read far more data off the
> wire than we immediately need. When using a connection from a
> single thread this isn't a problem, since only our reply will
> be pending (or an event we can handle directly). When using a
> connection from multiple threads though, we may read the data
> from replies from other threads. If those replies occur after
> our own reply, they'll not be processed. The other thread will
> then go into poll() and wait for its reply which has already
> been received and decoded. The solution is to set poll() timeout
> to 0 if there is pending SASL data.
> 
> * src/remote/remote_driver.c: Don't sleep in poll() if SASL
>   data exists
> ---
>  src/remote/remote_driver.c |   16 +++++++++++++++-
>  1 files changed, 15 insertions(+), 1 deletions(-)

ACK.

Will your refactoring to make things use socket wrappers that do SASL
transparently under the hood be complete any time soon?  But this patch
is good in the meantime.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110201/c87ac621/attachment-0001.sig>


More information about the libvir-list mailing list