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 dangling archiver goroutine #19516

Merged

Commits on Apr 26, 2022

  1. Prevent dangling archiver goroutine

    Within doArchive there is a service goroutine that performs the
    archiving function.  This goroutine reports its error using a `chan
    error` called `done`. Prior to this PR this channel had 0 capacity
    meaning that the goroutine would block until the `done` channel was
    cleared - however there are a couple of ways in which this channel might
    not be read.
    
    The simplest solution is to add a single space of capacity to the
    goroutine which will mean that the goroutine will always complete and
    even if the `done` channel is not read it will be simply garbage
    collected away.
    
    (The PR also contains two other places when setting up the indexers
    which do not leak but where the blocking of the sending goroutine is
    also unnecessary and so we should just add a small amount of capacity
    and let the sending goroutine complete as soon as it can.)
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath committed Apr 26, 2022
    Configuration menu
    Copy the full SHA
    d603244 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    abe6745 View commit details
    Browse the repository at this point in the history