fix #6224: disks: get: set timeout for retrieval of SMART stat data

In rare scenarios, `smartctl` takes up to 60 seconds to timeout for SCSI
commands to be completed, as reported in our user forum [0] and bugzilla
[1]. It seems that USB drives handled by the USB Attached SCSI (UAS)
kernel module are more likely to be affected by this [2], but is more of
a case-by-case situation.

Therefore, set a more reasonable timeout of 10 seconds, so that callers
don't have to wait too long or seem unresponsive (e.g. Node Disks view
in the WebGUI).

[0] https://forum.proxmox.com/threads/164799/
[1] https://bugzilla.proxmox.com/show_bug.cgi?id=6224
[2] https://www.smartmontools.org/wiki/SAT-with-UAS-Linux

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Link: https://lore.proxmox.com/20250415071123.36921-3-d.kral@proxmox.com
This commit is contained in:
Daniel Kral
2025-04-15 09:11:23 +02:00
committed by Thomas Lamprecht
parent b6c18e9116
commit ebec84ff87

View File

@ -102,6 +102,7 @@ sub get_smart_data {
run_command(
$cmd,
noerr => 1,
timeout => 10,
outfunc => sub {
my ($line) = @_;