Skip to content

fix: goroutine leak in TestRingLogger#51854

Merged
thaJeztah merged 1 commit intomoby:masterfrom
VedantMadane:fix-ring-test-goroutine-leak
Jan 19, 2026
Merged

fix: goroutine leak in TestRingLogger#51854
thaJeztah merged 1 commit intomoby:masterfrom
VedantMadane:fix-ring-test-goroutine-leak

Conversation

@VedantMadane
Copy link
Contributor

@VedantMadane VedantMadane commented Jan 15, 2026

Summary

Fixes a goroutine leak in TestRingLogger by using
ing.Close() instead of
ing.setClosed().

Details

ing.setClosed() only sets the close flag but doesn't:

  • Call
    .buffer.Close() which would broadcast to waiting goroutines
  • Wait for goroutines to finish

This leaves the goroutine started by
ewRingLogger waiting forever on cond.Wait().

ing.Close() properly broadcasts to wake up waiting goroutines and waits for them to complete.

Test plan

  • Simple one-line fix
  • CI tests pass

Fixes #49717

@thaJeztah
Copy link
Member

Thank you for contributing! It appears your commit message is missing a DCO sign-off,
causing the DCO check to fail.

We require all commit messages to have a Signed-off-by line with your name
and e-mail (see "Sign your work"
in the CONTRIBUTING.md in this repository), which looks something like:

Signed-off-by: YourFirsName YourLastName <[email protected]>

There is no need to open a new pull request, but to fix this (and make CI pass),
you need to amend the commit(s) in this pull request, and "force push" the amended
commit.

Unfortunately, it's not possible to do so through GitHub's web UI, so this needs
to be done through the git commandline.

You can find some instructions in the output of the DCO check (which can be found
in the "checks" tab on this pull request), as well as in the Moby contributing guide.

Steps to do so "roughly" come down to:

  1. Set your name and e-mail in git's configuration:

    git config --global user.name "YourFirstName YourLastName"
    git config --global user.email "[email protected]"

    (Make sure to use your real name (not your GitHub username/handle) and e-mail)

  2. Clone your fork locally

  3. Check out the branch associated with this pull request

  4. Sign-off and amend the existing commit(s)

    git commit --amend --no-edit --signoff

    If your pull request contains multiple commits, either squash the commits (if
    needed) or sign-off each individual commit.

  5. Force push your branch to GitHub (using the --force or --force-with-lease flags) to update the pull request.

Sorry for the hassle (I wish GitHub would make this a bit easier to do), and let me know if you need help or more detailed instructions!

@thaJeztah thaJeztah added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jan 16, 2026
Use ring.Close() instead of ring.setClosed() to properly broadcast to waiting goroutines and prevent goroutine leak.

Fixes moby#49717

Signed-off-by: Vedant Madane <[email protected]>
@VedantMadane VedantMadane force-pushed the fix-ring-test-goroutine-leak branch from 365a64a to bead7d7 Compare January 16, 2026 10:52
@thaJeztah thaJeztah added status/2-code-review and removed dco/no Automatically set by a bot when one of the commits lacks proper signature labels Jan 19, 2026
@thaJeztah thaJeztah added this to the 29.2.0 milestone Jan 19, 2026
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

@thaJeztah thaJeztah merged commit a2f2ed6 into moby:master Jan 19, 2026
192 of 193 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A potential goroutine leak in daemon/logger/ring_test.go

2 participants