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

prevent dependencies from being added after stop #1898

Merged
merged 2 commits into from
Mar 21, 2024
Merged

prevent dependencies from being added after stop #1898

merged 2 commits into from
Mar 21, 2024

Commits on Mar 19, 2024

  1. prevent dependencies from being added after stop

    A Nomad user reported an issue where `View.poll` goroutines were being leaked
    when using large templates. When the runner's `Run` method is in-flight and the
    runner concurrently receives `Stop`, it's possible for the watcher to stop
    dependencies via stop and then immediately recreate them. Because the `Stop`
    method has returned, the caller will assume that all goroutines have been
    stopped, and this causes the `View.poll` goroutines to be leaked. The race
    condition for this case is very narrow, but is most likely to occur when the
    user has both a very large number of dependencies, short secret leases, and the
    `Wait` configuration is nil.
    
    Add a `stopped` flag to the `Watcher` which is set on `Stop`, and check whether
    this field has been set before adding a new dependency.
    tgross committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    7b0ce5b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f0cecf7 View commit details
    Browse the repository at this point in the history