RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 594741 - QMP: Server doesn't flush input queue on connection close
Summary: QMP: Server doesn't flush input queue on connection close
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Luiz Capitulino
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 559201 580953
TreeView+ depends on / blocked
 
Reported: 2010-05-21 13:31 UTC by Luiz Capitulino
Modified: 2010-11-10 16:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-10 16:49:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Luiz Capitulino 2010-05-21 13:31:55 UTC
Description of problem:

QMP should flush the input queue when client disconnects, but it doesn't.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.60.el6

How reproducible:


Steps to Reproduce:
1. Open a QMP connection to a unix socket with the following options:

# qemu-kvm [...] -qmp unix:./qmp-sock,server,nowait -S

2. QEMU's SDL window should appear

3. Run the qmp-flush-bug script (attached), eg:

# qmp-flush-bug ./qmp-sock
  
Actual results:

Script returns but qemu-kvm remains running (ie. the SDL window is still opened).

Expected results:

qemu-kvm should exit when script is run.

Additional info:

Comment 1 Luiz Capitulino 2010-05-21 13:34:57 UTC
Two comments:

1. Not sure if this is tier2, maybe it's tier3

2. The fix should be simple, ie. something like this:

diff --git a/monitor.c b/monitor.c
index a1ebc5d..b1880e0 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4547,6 +4547,7 @@ static void monitor_control_event(void *opaque, int event)
         qobject_decref(data);
         break;
     case CHR_EVENT_CLOSED:
+        json_message_parser_flush(&mon->mc->parser);
         json_message_parser_destroy(&mon->mc->parser);
         break;
     }

But this causes a segfault, not sure why.

Comment 2 RHEL Program Management 2010-05-21 13:36:04 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Luiz Capitulino 2010-07-02 00:28:56 UTC
I've tried the stupid solution for this one, but it didn't work. Not sure how
important this is now, as our parser will handle the input as soon as
it's a complete sentence.

I mean, some weeks ago clients would have to send a trailing space to make
our parser consume the input, like:

 { "execute": "system_reset" }\r

So, if the client closes the connection after sending '}' but before '\r',
the system_reset command wouldn't be executed. In this case, not flushing
the input is clearly visible as a bug, as QMP would just discard valid
input.

However, today (rhel6 & upstream) our parser will consume the input as soon as
it sees the '}' character.

Not sure this is a bug, will move it to rhel6.1 so that we can evaluate again in the future.

Comment 5 Luiz Capitulino 2010-11-10 16:49:42 UTC
Recent changes in the parser (already backported to 6.0) makes this problem go away. It's true that QMP doesn't flush the input buffer on connection close, but valid input should be immediately handled when the last character of the input object is received.

Closing as not a bug.


Note You need to log in before you can comment on or make changes to this bug.