File tree 1 file changed +12
-1
lines changed
components/ws-manager/pkg/manager 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ package manager
7
7
import (
8
8
"context"
9
9
"strings"
10
+ "time"
10
11
11
12
"golang.org/x/xerrors"
13
+ "k8s.io/apimachinery/pkg/util/wait"
12
14
"k8s.io/client-go/util/retry"
13
15
14
16
"github.com/gitpod-io/gitpod/common-go/log"
@@ -79,8 +81,17 @@ const (
79
81
80
82
// markWorkspaceAsReady adds annotations to a workspace pod
81
83
func (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
+ }
82
93
// 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 {
84
95
pod , err := m .findWorkspacePod (ctx , workspaceID )
85
96
if err != nil {
86
97
return xerrors .Errorf ("cannot find workspace %s: %w" , workspaceID , err )
You can’t perform that action at this time.
0 commit comments