qemu: clear qmp state before wait for qemu process#536
qemu: clear qmp state before wait for qemu process#536jodh-intel merged 2 commits intokata-containers:masterfrom
Conversation
So that if there is any remaining state, we do not let it interfere with the new one. This should fix the occasional vm factory hang. Fixes: kata-containers#535 Signed-off-by: Peng Tao <bergwolf@gmail.com>
|
PSS Measurement: Memory inside container: |
Codecov Report
@@ Coverage Diff @@
## master #536 +/- ##
==========================================
- Coverage 66.67% 66.66% -0.01%
==========================================
Files 93 93
Lines 9580 9614 +34
==========================================
+ Hits 6387 6409 +22
- Misses 2506 2517 +11
- Partials 687 688 +1 |
|
Build succeeded (third-party-check pipeline).
|
|
lgtm /cc @markdryan. |
|
As long this change abides by the constraints in the API documentation it should be okay: https://github.com/intel/govmm/blob/master/qemu/qmp.go#L591 If it doesn't you might get a panic. |
|
@markdryan At the point of |
|
@bergwolf Can we be sure no one else has called Shutdown on this instance? If so it should be okay. You could also read from the disconnectedChannel which will block until the connection is truly closed. This is what all the test cases do, e.g., https://github.com/intel/govmm/blob/master/qemu/qmp_test.go#L497 |
|
@markdryan |
|
@bergwolf, I'd missed that. I thought you were calling Shutdown directly. Reading from the disconnected channel might still be a good idea though. |
That is how govmm ensures us that the qmp channel has been cleaned up entirely. Signed-off-by: Peng Tao <bergwolf@gmail.com>
|
@markdryan Yes, you are right. It still makes sense to wait on the disconnected channel. I've added a new commit to do it. PTAL. |
|
lgtm |
|
PSS Measurement: Memory inside container: |
|
Build failed (third-party-check pipeline) integration testing with
|
|
Ignoring 0.01% drop in code cov... |
…lpha1-branch-bump # Kata Containers 1.7.0-alpha1
So that if there is any remaining state, we do not let it interfere
with the new one. This should fix the occasional vm factory hang.