File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
components/ws-manager/pkg/manager Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ package manager
77import (
88 "context"
99 "strings"
10+ "time"
1011
1112 "golang.org/x/xerrors"
13+ "k8s.io/apimachinery/pkg/util/wait"
1214 "k8s.io/client-go/util/retry"
1315
1416 "github.com/gitpod-io/gitpod/common-go/log"
@@ -79,8 +81,17 @@ const (
7981
8082// markWorkspaceAsReady adds annotations to a workspace pod
8183func (m * Manager ) markWorkspace (ctx context.Context , workspaceID string , annotations ... * annotation ) error {
84+ // use custom backoff, as default one fails after 1.5s, this one will try for about 25s
85+ // we want to try harder to remove or add annotation, as failure to remove "gitpod/never-ready" annotation
86+ // would cause whole workspace to be marked as failed, hence the reason to try harder here.
87+ var backoff = wait.Backoff {
88+ Steps : 7 ,
89+ Duration : 100 * time .Millisecond ,
90+ Factor : 2.0 ,
91+ Jitter : 0.1 ,
92+ }
8293 // Retry on failure. Sometimes this doesn't work because of concurrent modification. The Kuberentes way is to just try again after waiting a bit.
83- err := retry .RetryOnConflict (retry . DefaultBackoff , func () error {
94+ err := retry .RetryOnConflict (backoff , func () error {
8495 pod , err := m .findWorkspacePod (ctx , workspaceID )
8596 if err != nil {
8697 return xerrors .Errorf ("cannot find workspace %s: %w" , workspaceID , err )
You can’t perform that action at this time.
0 commit comments