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

DelayingQueue.ShutDown() should be reentrant #77170

Merged

Conversation

@smarterclayton
Copy link
Contributor

commented Apr 27, 2019

All queue ShutDown() calls should be able to be invoked multiple times.

goroutine 228 [running]:
github.com/openshift/cluster-version-operator/vendor/k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
	/go/src/github.com/openshift/cluster-version-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:58 +0x107
panic(0x12a5960, 0x1556450)
	/usr/local/go/src/runtime/panic.go:502 +0x229
github.com/openshift/cluster-version-operator/vendor/k8s.io/client-go/util/workqueue.(*delayingType).ShutDown(0xc4206899a0)
	/go/src/github.com/openshift/cluster-version-operator/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go:137 +0x45

Use sync.Once to guarantee a single close.

/kind bug

DelayingQueue.ShutDown() is now able to be invoked multiple times without causing a closed channel panic.
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Apr 27, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smarterclayton

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 requested review from lavalamp and liggitt Apr 27, 2019

@smarterclayton

This comment has been minimized.

Copy link
Contributor Author

commented Apr 28, 2019

/retest

DelayingQueue.ShutDown() should be reentrant
All queue ShutDown() calls should be able to be invoked multiple times.

```
Observed a panic: "close of closed channel" (close of closed channel)
/go/src/github.com/openshift/cluster-version-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:76
/go/src/github.com/openshift/cluster-version-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:65
/go/src/github.com/openshift/cluster-version-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:51
/usr/local/go/src/runtime/asm_amd64.s:573
/usr/local/go/src/runtime/panic.go:502
/usr/local/go/src/runtime/chan.go:333
/go/src/github.com/openshift/cluster-version-operator/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go:137
```

Use sync.Once to guarantee a single close.

@smarterclayton smarterclayton force-pushed the smarterclayton:delay_queue_reentrant branch from ac25646 to d2f7eb5 May 17, 2019

@k8s-ci-robot k8s-ci-robot added size/S and removed size/XS labels May 17, 2019

@smarterclayton

This comment has been minimized.

Copy link
Contributor Author

commented May 17, 2019

Updated

@liggitt

This comment has been minimized.

Copy link
Member

commented May 17, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label May 17, 2019

@k8s-ci-robot k8s-ci-robot merged commit 4891eaa into kubernetes:master May 18, 2019

20 checks passed

cla/linuxfoundation smarterclayton authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
nikhita pushed a commit to nikhita/kubernetes that referenced this pull request Jun 13, 2019
Merge pull request kubernetes#77170 from smarterclayton/delay_queue_r…
…eentrant

DelayingQueue.ShutDown() should be reentrant

Kubernetes-commit: 4891eaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.