NewTypedDelayingQueueWithConfig spawns a goroutine, but apparently shutdown is
already handled somehow. Therefore only the option to set a logger gets added
to the Config struct.
The problem then becomes that developers might forget to set that
logger. logcheck can't detect that. For now, all in-tree users get updated
immediately.
Kubernetes-commit: f20eb2e7c16a9b28e69fd0bba2000e7166d68f29
With this change, we can typically avoid an extra heap allocation when
calling AddAfter with a positive duration (which causes the creation of
a waitFor object). This is because workqueues are typically used with
string keys, and casting a string (or more generally, non-pointer types)
to an `interface{}` will cause an heap escape / allocation.
Ater this change, there is no longer any usage of `type t interface{}`,
which was creating some confusion after the switch to generics in the
workqueue package.
Co-authored-by: Quan Tian <quan.tian@broadcom.com>
Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
Kubernetes-commit: 53ddffb55709857fec6bddbd5ca4ca1b03f7da97
It was added for compatibility reason but ended up getting a `config`
argument by accident, resulting in not actually being compatible, this
change fixes that.
Kubernetes-commit: 6933c1bc229c196e9c71061e19a0cdc76adb1dbc
This change renames NewTypedDelayingQueue to NewTypedDelayingQueue to
stay consistent with the naming scheme in the package. A
NewTypedDelayingQueue constructor is kept for backwards compatibility
but marked as deprecated.
Kubernetes-commit: 45da5dc30ecf0ba4c4b44befd96b8617278c496b
This change adds a generic version of the various workqueue types while
retaining compatibility for the existing exported symbols and constructors.
The generic variants are prefixed with `Typed` and the existing ones are
marked as deprecated to nudge people to transition without breaking
them.
Kubernetes-commit: 0c7370bb851c15825d30a516722139ccccca0cfc
Two simple choices for workqueues do not document that they do not emit
metrics. Using their named variants fixes this, but was undocumented.
Change-Id: I100ad08a4859513987941ed35d12abb4cbb39873
Kubernetes-commit: f468bee672b0ccf9b97a85f17ec1f5645aced926
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.
Kubernetes-commit: d2f7eb5235a93556261c8947e7a87342aeeaee2b