kata-containers / kata-containers

Kata Containers is an open source project and community working to build a standard implementation of lightweight Virtual Machines (VMs) that feel and perform like containers, but provide the workload isolation and security advantages of VMs. https://katacontainers.io/
Apache License 2.0
5.08k stars 1k forks source link

vhost-user-blk reconnect parameter in configuration.toml not working as expected #9848

Open markyangcc opened 1 week ago

markyangcc commented 1 week ago

Issue Description

The vhost_user_reconnect_timeout_sec parameter in the configuration.toml file is intended to set the reconnect timeout for vhost-user devices. However, the actual log output consistently shows ReconnectTime as zero, which does not reflect the value specified in the configuration.

Actual Result

The log indicates that ReconnectTime is always zero, regardless of the configuration value set for vhost_user_reconnect_timeout_sec:

level=info msg="Attaching device" Index=1 ReconnectTime=0 SocketPath=/var/run/kata-containers/vhost-user/block/sockets/vhostblk7 Type=vhost-user-blk-pci device=/var/run/kata-containers/vhost-user/block/sockets/vhostblk7 name=containerd-shim-v2 pid=2922759

Expected Result

The log should show like below, ReconnectTime should be set to 1 (vhost_user_reconnect_timeout_sec = 1)

level=info msg="Attaching device" Index=1 ReconnectTime=1 SocketPath=/var/run/kata-containers/vhost-user/block/sockets/vhostblk7 Type=vhost-user-blk-pci device=/var/run/kata-containers/vhost-user/block/sockets/vhostblk7 name=containerd-shim-v2 pid=2922759

Would be fixed by https://github.com/kata-containers/kata-containers/pull/9849