-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix(executor): Delegate PNS wait to K8SAPI executor. #5307
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,14 +158,13 @@ func (p *PNSExecutor) Wait(ctx context.Context, containerNames, sidecarNames []s | |
time.Sleep(1 * time.Second) | ||
} | ||
|
||
if !p.haveContainerPIDs(containerNames) { | ||
log.Info("container PIDs still unknown (maybe short running container, or late starting)") | ||
return p.K8sAPIExecutor.Wait(ctx, containerNames, sidecarNames) | ||
} | ||
|
||
OUTER: | ||
for _, containerName := range containerNames { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very rarely, containers can successfully complete, but the Kubernetes API does not yet know about it, so I don't see any easy way around this, so this reverts us to how v2.12. It's a shame to lose this performance boost, but a much worse shame to have unpredictable workflow failures. |
||
pid := p.getContainerPID(containerName) | ||
if pid == 0 { | ||
log.Infof("container %q pid unknown - maybe short running, or late starting container", containerName) | ||
continue | ||
} | ||
log.Infof("Waiting for %q pid %d to complete", containerName, pid) | ||
for { | ||
select { | ||
|
@@ -184,7 +183,8 @@ OUTER: | |
} | ||
} | ||
} | ||
return nil | ||
|
||
return p.K8sAPIExecutor.Wait(ctx, containerNames, sidecarNames) | ||
} | ||
|
||
// pollRootProcesses will poll /proc for root pids (pids without parents) in a tight loop, for the | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we terminate Sidecar containers also?