Skip to content

guest/storage/scsi: Print log warning if GetDevicePath blocks due to wait - #2471

Merged
ambarve merged 1 commit into
microsoft:mainfrom
micromaomao:tingmao/scsi-log
Sep 16, 2025
Merged

guest/storage/scsi: Print log warning if GetDevicePath blocks due to wait#2471
ambarve merged 1 commit into
microsoft:mainfrom
micromaomao:tingmao/scsi-log

Conversation

@micromaomao

Copy link
Copy Markdown
Member

When there is a problem with SCSI devices, this makes it easy to see why the GCS is not responding to the message. Otherwise one can only guess what's going on, which is not nice.

Example log line:

357,,LogrusEntry,1,3788,scsi::GetDevicePath blocked for more than 5 seconds waiting for SCSI device to show up in sysfs,07/09/2025 17:04:43.141,/sys/bus/scsi/devices/0:0:0:4/block,02f3c1e0476efc9c,59134c6dc49a7ebcc06a90e9418e0ab2,12618e3ed8893cfcb61e61f658d9c8bae1a9de8dc6ddbf8340d4861cfe28d20e@vm,2025-07-09T17:04:43.140829300Z,,,,,,,,,,,,,,,1,34.410196300

@micromaomao
micromaomao requested a review from a team as a code owner July 9, 2025 20:42
@micromaomao

Copy link
Copy Markdown
Member Author

No change rebase to main

case <-ctx.Done():
return "", ctx.Err()
default:
if !logged && logTime.Before(time.Now()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought, why not <-time.After(time.Second * 5) as a case and then just continue. Yes you would get multiple log statements but it feels like thats ok. What if it takes 15 seconds? You would see multiple logs at 5 second intervals. But thats also helpful to see how long it is taking.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that wouldn't work because we will restart the loop on default in 10ms, then the timer will restart, right?

@micromaomao

Copy link
Copy Markdown
Member Author

@anmaxvl Can you check what's going on? Both of my PRs seems to be stuck with this git error in CI

…wait

When there is a problem with SCSI devices, this makes it easy to see why the GCS
is not responding to the message.

Signed-off-by: Tingmao Wang <tingmaowang@microsoft.com>
Comment thread internal/guest/storage/scsi/scsi.go
@ambarve
ambarve merged commit 80a68ad into microsoft:main Sep 16, 2025
50 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants