Skip to content

Commit e177b82

Browse files
aledbfroboquat
authored andcommitted
[ws-daemon] Increase WaitForContainer timeout
1 parent 1e22b35 commit e177b82

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

components/ws-daemon/pkg/container/containerd.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ func (s *Containerd) handleNewTask(cid string, rootfs []*types.Mount, pid uint32
306306
func (s *Containerd) WaitForContainer(ctx context.Context, workspaceInstanceID string) (cid ID, err error) {
307307
//nolint:ineffassign
308308
span, ctx := opentracing.StartSpanFromContext(ctx, "WaitForContainer")
309+
span.LogKV("workspaceInstanceID", workspaceInstanceID)
309310
defer tracing.FinishSpan(span, &err)
310311

311312
rchan := make(chan ID, 1)
@@ -348,6 +349,7 @@ func (s *Containerd) WaitForContainer(ctx context.Context, workspaceInstanceID s
348349
func (s *Containerd) WaitForContainerStop(ctx context.Context, workspaceInstanceID string) (err error) {
349350
//nolint:ineffassign
350351
span, ctx := opentracing.StartSpanFromContext(ctx, "WaitForContainerStop")
352+
span.LogKV("workspaceInstanceID", workspaceInstanceID)
351353
defer tracing.FinishSpan(span, &err)
352354

353355
rchan := make(chan struct{}, 1)

components/ws-daemon/pkg/dispatch/dispatch.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ func (d *Dispatch) handlePodUpdate(oldPod, newPod *corev1.Pod) {
199199
},
200200
}
201201

202-
waitForPodCtx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
202+
// Important!!!!: ideally this timeout must be equal to ws-manager https://github.com/gitpod-io/gitpod/blob/main/components/ws-manager/pkg/manager/manager.go#L171
203+
waitForPodCtx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
203204
containerCtx, containerCtxCancel := context.WithCancel(context.Background())
204205
containerCtx = context.WithValue(containerCtx, contextDispatch, d)
205206
go func() {

0 commit comments

Comments
 (0)