提交 07b39a94 编写于 作者: D Daniel P. Berrange

Unregister event callback if a fatal error occurs during dispatch

If we get an I/O error in the async event callback for an RPC
client, we might not have consumed all pending data off the
wire. This could result in the callback being immediately
invoked again. At which point the same I/O might occur. And
we're invoked again. And again...And again...

Unregistering the async event callback if an error occurs is
a good safety net. The real error will be seen when the next
RPC method is invoked

* src/rpc/virnetclient.c: Unregister event callback on error
上级 8665f855
......@@ -1117,8 +1117,10 @@ void virNetClientIncomingEvent(virNetSocketPtr sock,
goto done;
}
if (virNetClientIOHandleInput(client) < 0)
VIR_DEBUG("Something went wrong during async message processing");
if (virNetClientIOHandleInput(client) < 0) {
VIR_WARN("Something went wrong during async message processing");
virNetSocketRemoveIOCallback(sock);
}
done:
virNetClientUnlock(client);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册