Closed keyingliu closed 5 years ago
@ivan4th @jellonek any comments about this?
This case should be handled by https://github.com/Mirantis/virtlet/blob/ea3fd68647ef79d82b834d864a707871096f0cd8/pkg/tapmanager/tapfdsource.go#L312 but i'll take a deeper look on that soon if you are facing an issue in this place actually.
@jellonek there is such case I met: virtlet gets exited for some reasons, and during the restart, recover is executed without the TAP or other fds, everything is fine now. But later the qemu process may quit, kubelet will try to start a new one, but vmwrapper will fail to read the fds because during the Recover
the TAP's FD is not opened.
You may look: https://github.com/Mirantis/virtlet/blob/master/pkg/nettools/nettools.go#L706, it just got the ifaceType
, after the flow, the qemu cannot get started:
(virtlet/qemu running) -> (virtlet restarted) -> (qemu quits for some reasons) -> (the quited qemu should be restarted but it fails with error), the error is:
Failed to obtain tap fds for key "xxxxx-xxx": bad oob data size: 0 instead of 16
close as PR has been merged: https://github.com/Mirantis/virtlet/pull/864
There is such case: virtlet gets exited for some reasons, and during the restart, recover is executed without the TAP or other fds, everything is fine now. But later the qemu process may quit, kubelet will try to start a new one, but vmwrapper will fail to read the fds.
Can we extend the FDSource to add new method? If
GetFDs
is called, that means the VM is going to start, if FDServer found the fds is nil, it can call this method to retrieve the fds.The code snippet look like: