Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

log a warning when updateCh is full #13

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

ElvinEfendi
Copy link

NOTE: this is mostly at an idea phase and WIP

Recently there was an issue reported at kubernetes#2022 where the controller was not able to start Nginx. This was because there were too many events and updateCh was full and writes were failing. The the author fixed it at kubernetes#2082 where he uses RingChannel instead. That channel will never block writes and instead drop the oldest value when it is full. And he uses 1024 as a buffer size again. But there can be cases where dropping an event might lead to incorrect behaviour:
Imagine there are 2 namespaces generating events. A resource in n1 generated an event and at the same time something was on fire in n2 where it generated 1024 all of a sudden which would mean the controller will drop the event that happened for n1, so it will never regenerate the Nginx config for that namespace.

The PR adds a logging so that we can at least see when this edge case happens.

@zrdaley @Shopify/edgescale
/cc @Shopify/cloudplatform

karanthukral and others added 30 commits August 9, 2017 15:22
Revert to using proxy_protocol_addr for real ip
Fix container not booting
Introduce an upstream-hash-by annotation to support consistent hashing by nginx variable
Fix regressions from the initial pass of the upstream-hash-by annotation
make sure http host is passed to upstream
@mkobetic
Copy link

mkobetic commented Mar 1, 2018

Hm, the whole RingBuffer idea sounds fishy to me TBH, but this whole issue seems to require understanding of informers and store and how they are used along with the controller channels, all of which I lack atm :/.

@ibawt
Copy link

ibawt commented Mar 1, 2018

if one thing can monopolize the update queue I imagine the proper fix would be an event scheduler. kind of like having a queue per resource and pulling them off in some sort of "fair" manner.

A ring buffer will discard things, but what events will it discard? If it's the thing that's spamming then sure, fuck them. If it's the actual update we want a ring buffer will just cause the same problem.

@ibawt
Copy link

ibawt commented Mar 1, 2018

oh and this repo is public btw, is this what we want for these discussions?

@ElvinEfendi ElvinEfendi changed the title log a wardning when updateCh is full log a warnning when updateCh is full Mar 8, 2018
@ElvinEfendi ElvinEfendi changed the title log a warnning when updateCh is full log a warning when updateCh is full Mar 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants