[libvirt] [BUG?] EAGAIN not triggering error and 'events' gets cleared

Dear Libvirt Developers, There seems to be a bug or at least a bad behavior in `src/qemu/qemu_monitor.c' lines 683-689 function `qemuMonitorIO': if (qemuMonitorIOWrite(mon) < 0) { error = true; if (errno == ECONNRESET) hangup = true; } events &= ~VIR_EVENT_HANDLE_WRITABLE; The `qemuMonitorIOWrite' is returning 0 in case 'write' returns EAGAIN thus 'events' is always cleared of `VIR_EVENT_HANDLE_WRITABLE' even in case no message have been sent indeed. The question is: who is responsible for handling this? It seems like 'errno' is getting overwritten inside all of qemuMonitorJSON* functions so the caller can't rely on it and it needs to be fixed inside the `qemuMonitorIO'. Pavel

Well, actually that seems to be quite a different bug in there. I will start a new thread. In short: migration seems to be broken by commit 1a92c719101e5bfa6fe2b78006ad04c7f075ea28. This is because introduced job _MODIFY waits while MIGRATION_OUT is finished to change `mirrorState' variable. This deadlocks the libvirt. Pavel On Tue, Apr 28, 2015 at 6:29 AM, Pavel Boldin <pboldin@mirantis.com> wrote:
Dear Libvirt Developers,
There seems to be a bug or at least a bad behavior in `src/qemu/qemu_monitor.c' lines 683-689 function `qemuMonitorIO':
if (qemuMonitorIOWrite(mon) < 0) { error = true; if (errno == ECONNRESET) hangup = true; } events &= ~VIR_EVENT_HANDLE_WRITABLE;
The `qemuMonitorIOWrite' is returning 0 in case 'write' returns EAGAIN thus 'events' is always cleared of `VIR_EVENT_HANDLE_WRITABLE' even in case no message have been sent indeed.
The question is: who is responsible for handling this? It seems like 'errno' is getting overwritten inside all of qemuMonitorJSON* functions so the caller can't rely on it and it needs to be fixed inside the `qemuMonitorIO'.
Pavel

On 28.04.2015 11:06, Pavel Boldin wrote:
Well, actually that seems to be quite a different bug in there.
I will start a new thread.
In short: migration seems to be broken by commit 1a92c719101e5bfa6fe2b78006ad04c7f075ea28. This is because introduced job _MODIFY waits while MIGRATION_OUT is finished to change `mirrorState' variable. This deadlocks the libvirt.
Yep, this is known bug. I've told Peter already like two weeks ago. He promised to fix it. It would be nice if we can get the fix into the release. Michal

On Tue, Apr 28, 2015 at 11:24:37 +0200, Michal Privoznik wrote:
On 28.04.2015 11:06, Pavel Boldin wrote:
Well, actually that seems to be quite a different bug in there.
I will start a new thread.
In short: migration seems to be broken by commit 1a92c719101e5bfa6fe2b78006ad04c7f075ea28. This is because introduced job _MODIFY waits while MIGRATION_OUT is finished to change `mirrorState' variable. This deadlocks the libvirt.
Yep, this is known bug. I've told Peter already like two weeks ago. He promised to fix it. It would be nice if we can get the fix into the release.
There are already patches for the issue: http://www.redhat.com/archives/libvir-list/2015-April/msg00724.html

Thanks Peter, It looks good but I did no deep introspection of the code. Should I rebase my patch [1] on that? I can test your code as well then. [1] https://github.com/paboldin/libvirt/commits/master Pavel On Tue, Apr 28, 2015 at 4:42 PM, Peter Krempa <pkrempa@redhat.com> wrote:
On Tue, Apr 28, 2015 at 11:24:37 +0200, Michal Privoznik wrote:
On 28.04.2015 11:06, Pavel Boldin wrote:
Well, actually that seems to be quite a different bug in there.
I will start a new thread.
In short: migration seems to be broken by commit 1a92c719101e5bfa6fe2b78006ad04c7f075ea28. This is because introduced job _MODIFY waits while MIGRATION_OUT is finished to change `mirrorState' variable. This deadlocks the libvirt.
Yep, this is known bug. I've told Peter already like two weeks ago. He promised to fix it. It would be nice if we can get the fix into the release.
There are already patches for the issue:
http://www.redhat.com/archives/libvir-list/2015-April/msg00724.html
participants (3)
-
Michal Privoznik
-
Pavel Boldin
-
Peter Krempa