Commit Graph

4 Commits

Author SHA1 Message Date
Wojciech Tyczyński 107350e97d Fix missed watch events
Kubernetes-commit: 3277d85604d7d8845f56f670fb83b65982cdddf3
2023-03-01 12:16:40 +01:00
Wojciech Tyczyński ba5f84614d Fix deadlock in ready test
Kubernetes-commit: 39fa78fe7d6020b508308e84c8b671273731dfd6
2023-03-03 14:09:32 +01:00
Antonio Ojea 33153a1931 cacher allow context cancellation if not ready (#116024)
* cacher allow context cancellation if not ready

Replace the sync.Cond variable with a channel so we can use the
context cancellation signal.

Co-authored-by: Wojciech Tyczy<C5><84>ski <wojtekt@google.com>
Change-Id: I2f75313a6337feee440ece4c1e873c32a12560dd

* wait again on pending state

Change-Id: I1ad79253a5a5d56a4d9611125825b1f7ad552be8

---------

Co-authored-by: Wojciech Tyczy<C5><84>ski <wojtekt@google.com>

Kubernetes-commit: 3b17aece1fa492e98aa82b948597b3641961195f
2023-02-28 11:23:16 +00:00
Antonio Ojea 00730c9649 apiserver cacher: don't accept requests if stopped
The cacher blocks requests until it is ready, however, the
ready variable doesn't differentiate if the cacher was stopped.

The cacher is using a condition variable based on sync.Cond to
handle the readiness, however, this was not taking into account
if it was not ready because it was waiting to be ready or it was
stopped.

Add a new condition to the condition variable to handle the
stop condition, and returning an error to signal the goroutines
that they should stop waiting and bail out.

Kubernetes-commit: 2cb3a56e83ae33464edb174b1b6373ba50600759
2022-03-03 12:01:59 +01:00