Commit 93295354 (netlink-socket: Simplify multithreaded dumping
to match Linux reality.) makes the call to recvmsg() block if no
messages are available.  This can cause revalidator threads hanging
for long time or even deadlock when main thread tries to stop the
revalidator threads.

This commit fixes the issue by enabling the MSG_DONTWAIT flag in
the call to recvmsg().

Signed-off-by: Alex Wang <[email protected]>
---
 lib/netlink-socket.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
index b1e6804..5a38938 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -724,7 +724,7 @@ nl_dump_refill(struct nl_dump *dump, struct ofpbuf *buffer)
     int error;
 
     while (!ofpbuf_size(buffer)) {
-        error = nl_sock_recv__(dump->sock, buffer, true);
+        error = nl_sock_recv__(dump->sock, buffer, false);
         if (error) {
             /* The kernel shouldn't return EAGAIN while there's data left. */
             return error == EAGAIN ? EOF : error;
-- 
1.7.9.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to