This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Commit c735bee
committed
QemuContext.qmpSend: new function that check ctx status before send data to qc.qmp
Got following panic in hyperd:
hyperd[26359]: E0326 06:39:44.147320 26359 stop.go:20] failed to shuting down: not in running state
hyperd[26359]: panic: send on closed channel
hyperd[26359]: goroutine 28404 [running]:
hyperd[26359]: github.com/hyperhq/hyperd/vendor/github.com/hyperhq/runv/hypervisor/qemu.newDiskDelSession(0xc421f0e2c0, 0xc422aa6180, 0x1, 0x219a420, 0xc420b38880
hyperd[26359]: /root/gopath/src/github.com/hyperhq/hyperd/vendor/github.com/hyperhq/runv/hypervisor/qemu/qmp_wrapper.go:80 +0x4bd
hyperd[26359]: github.com/hyperhq/hyperd/vendor/github.com/hyperhq/runv/hypervisor/qemu.(*QemuContext).RemoveDisk(0xc422aa6180, 0xc421f0e2c0, 0xc42035cb00, 0x219a
hyperd[26359]: /root/gopath/src/github.com/hyperhq/hyperd/vendor/github.com/hyperhq/runv/hypervisor/qemu/qemu.go:259 +0x61
hyperd[26359]: github.com/hyperhq/hyperd/vendor/github.com/hyperhq/runv/hypervisor.(*DiskContext).remove.func1(0xc423c4ac90, 0xc420bc0240)
hyperd[26359]: /root/gopath/src/github.com/hyperhq/hyperd/vendor/github.com/hyperhq/runv/hypervisor/disk.go:127 +0xd0
hyperd[26359]: created by github.com/hyperhq/hyperd/vendor/github.com/hyperhq/runv/hypervisor.(*DiskContext).remove
hyperd[26359]: /root/gopath/src/github.com/hyperhq/hyperd/vendor/github.com/hyperhq/runv/hypervisor/disk.go:125 +0x18e
The reason is qc.qmp will be closed in QemuContext.Close when ctx closed.
But high level code doesn't know that and keep send data to qc.qmp.
Add this patch check the ctx status before send data to qc.qmp to handle
the issue.
Signed-off-by: Hui Zhu <teawater@hyper.sh>1 parent acc162c commit c735bee
2 files changed
+32
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
238 | 250 | | |
239 | 251 | | |
240 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
181 | 193 | | |
182 | 194 | | |
183 | 195 | | |
| |||
215 | 227 | | |
216 | 228 | | |
217 | 229 | | |
218 | | - | |
| 230 | + | |
219 | 231 | | |
220 | 232 | | |
221 | 233 | | |
222 | 234 | | |
223 | | - | |
| 235 | + | |
224 | 236 | | |
225 | 237 | | |
226 | 238 | | |
| |||
321 | 333 | | |
322 | 334 | | |
323 | 335 | | |
324 | | - | |
| 336 | + | |
325 | 337 | | |
326 | 338 | | |
327 | 339 | | |
328 | 340 | | |
329 | 341 | | |
330 | 342 | | |
331 | 343 | | |
332 | | - | |
| 344 | + | |
333 | 345 | | |
334 | 346 | | |
335 | 347 | | |
| |||
352 | 364 | | |
353 | 365 | | |
354 | 366 | | |
355 | | - | |
| 367 | + | |
356 | 368 | | |
357 | 369 | | |
358 | | - | |
| 370 | + | |
359 | 371 | | |
360 | 372 | | |
361 | 373 | | |
| |||
385 | 397 | | |
386 | 398 | | |
387 | 399 | | |
388 | | - | |
| 400 | + | |
389 | 401 | | |
390 | 402 | | |
391 | | - | |
| 403 | + | |
392 | 404 | | |
393 | 405 | | |
394 | 406 | | |
| |||
0 commit comments