Skip to content

Conversation

@andyzhangx
Copy link
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:
fix: goroutine leak

The write operation to a channel in Go is blocking unless there is a receiver waiting for it, this means after WaitUntilTimeout exit, the goroutine will remain stuck at done <- true forever.
After changed to buffered channel, even if there is no receiver, done <- true can successfully write and continue.

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

~/go/src/github.com/kubernetes-csi/csi-driver-smb/pkg/util# go test
--- FAIL: TestWaitUntilTimeout (3.44s)
    util_test.go:80: found unexpected goroutines:
        [Goroutine 8 in state chan send, with github.com/kubernetes-csi/csi-driver-smb/pkg/util.WaitUntilTimeout.func1 on top of the stack:
        github.com/kubernetes-csi/csi-driver-smb/pkg/util.WaitUntilTimeout.func1()
                /root/go/src/github.com/kubernetes-csi/csi-driver-smb/pkg/util/util.go:48 +0x65
        created by github.com/kubernetes-csi/csi-driver-smb/pkg/util.WaitUntilTimeout in goroutine 6
                /root/go/src/github.com/kubernetes-csi/csi-driver-smb/pkg/util/util.go:46 +0xb3
        ]
FAIL

Release note:

fix: goroutine leak

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels May 1, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 1, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 14768627236

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 78.178%

Totals Coverage Status
Change from base Build 14666256795: 0.0%
Covered Lines: 1107
Relevant Lines: 1416

💛 - Coveralls

@andyzhangx andyzhangx merged commit 14469c4 into kubernetes-csi:master May 1, 2025
17 of 18 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants