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

Backport of CSI: volume watcher shutdown fixes into release/1.2.x #12698

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #12439 to be assessed for backporting due to the inclusion of the label backport/1.2.x.

WARNING automatic cherry-pick of commits failed. Commits will require human attention.

The below text is copied from the body of the original PR.


The volume watcher design was based on deploymentwatcher and drainer,
but has an important difference: we don't want to maintain a goroutine
for the lifetime of the volume. So we stop the volumewatcher goroutine
for a volume when that volume has no more claims to free. But the
shutdown races with updates on the parent goroutine, and it's possible
to drop updates. Fortunately these updates are picked up on the next
core GC job, but we're most likely to hit this race when we're
replacing an allocation and that's the time we least want to wait.

Wait until the volume has "settled" before stopping this goroutine so
that the race between shutdown and the parent goroutine sending on
<-updateCh is pushed to after the window we most care about quick
freeing of claims.

  • Fixes a resource leak when volumewatchers are no longer needed. The
    volume is nil and can't ever be started again, so the volume's
    watcher should be removed from the top-level Watcher.

  • De-flakes the GC job test: the test throws an error because the
    claimed node doesn't exist and is unreachable. This flaked instead of
    failed because we didn't correctly wait for the first pass through the
    volumewatcher.

    Make the GC job wait for the volumewatcher to reach the quiescent
    timeout window state before running the GC eval under test, so that
    we're sure the GC job's work isn't being picked up by processing one
    of the earlier claims. Update the claims used so that we're sure the
    GC pass won't hit a node unpublish error.

  • Adds trace logging to unpublish operations

@lgfa29
Copy link
Contributor

lgfa29 commented Apr 20, 2022

Manually backported

@lgfa29 lgfa29 closed this Apr 20, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants