Skip to content

[pvc] potential workaround for mount volume failure #13594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions components/ws-manager/pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,12 @@ func podRunning(clientset client.Client, podName, namespace string) wait.Conditi
return true, nil
}
}
// if we failed to mount volume, we need to re-create the pod
// ref: https://github.com/gitpod-io/gitpod/issues/13353
// ref: https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/issues/608
if strings.Contains(pod.Status.Reason, "MountVolume.MountDevice failed for volume") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have a log when we-manager detects the issue happens? So we could know the number of times we hit this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have it. On line 361.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since we haven't reproduced it yet, and also we did not dump the pod YAML manifest when the last time Toru was able to reproduce. I worried that the ws-manager did not recreate the pod because one of the conditions mismatch

if c.Type == corev1.PodScheduled &&
c.Status == corev1.ConditionFalse &&
c.Reason == corev1.PodReasonUnschedulable {
return true
}

return false, xerrors.Errorf("failed mounting volume, reason: %s", pod.Status.Reason)
}

// if pod is pending, wait for it to get scheduled
return false, nil
Expand Down