Skip to content
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

Bug 1823406: Upstream: 89160: Remove potentially unhealthy symlink only for dead containers #24926

Merged
merged 1 commit into from
May 19, 2020

Conversation

tedyu
Copy link
Contributor

@tedyu tedyu commented Apr 28, 2020

As the discussion over #52172 showed, there is race condition between the container log rotation and the kubelet GC which may result in the loss of symlink.

Here is how container log rotation works (see containerLogManager#rotateLatestLog):

  • rename current log to rotated log file whose filename contains current timestamp (fmt.Sprintf("%s.%s", log, timestamp))
  • reopen the container log
  • if Add alpha API documentation #2 fails, rename rotated log file back to container log

There is small but indeterministic amount of time during which log file doesn't exist (between steps #1 and #2, between #1 and #3). Hence the symlink may be deemed unhealthy during that period.

This PR resorts to runtimeService.ContainerStatus() to check whether the container corresponding to the potentially unhealthy symlink is alive or not. The symlink would only be removed for dead containers.

…ontainers

Signed-off-by: Ted Yu <zyu@redhat.com>
@openshift-ci-robot openshift-ci-robot added the vendor-update Touching vendor dir or related files label Apr 28, 2020
@tedyu
Copy link
Contributor Author

tedyu commented Apr 28, 2020

/cc @rphillips @sjenning

@rphillips
Copy link
Contributor

/lgtm

/assign @sjenning

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 28, 2020
@rphillips
Copy link
Contributor

Upstream ref

@sjenning
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rphillips, sjenning, tedyu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2020
@rphillips
Copy link
Contributor

/retitle Bug 1823406: Remove potentially unhealthy symlink only for dead containers

@openshift-ci-robot openshift-ci-robot changed the title UPSTREAM: 89160: Remove potentially unhealthy symlink only for dead containers Bug 1823406: Remove potentially unhealthy symlink only for dead containers May 18, 2020
@rphillips
Copy link
Contributor

/retitle Bug 1823406: Upstream: 89160: Remove potentially unhealthy symlink only for dead containers

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label May 18, 2020
@openshift-ci-robot
Copy link

@tedyu: This pull request references Bugzilla bug 1823406, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1823406: Remove potentially unhealthy symlink only for dead containers

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 18, 2020
@openshift-ci-robot openshift-ci-robot changed the title Bug 1823406: Remove potentially unhealthy symlink only for dead containers Bug 1823406: Upstream: 89160: Remove potentially unhealthy symlink only for dead containers May 18, 2020
@tedyu
Copy link
Contributor Author

tedyu commented May 18, 2020

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit e629dda into openshift:master May 19, 2020
@openshift-ci-robot
Copy link

@tedyu: All pull requests linked via external trackers have merged: openshift/origin#24926. Bugzilla bug 1823406 has been moved to the MODIFIED state.

In response to this:

Bug 1823406: Upstream: 89160: Remove potentially unhealthy symlink only for dead containers

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. vendor-update Touching vendor dir or related files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants