{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/27984","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/27984/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/27984/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/27984/events","html_url":"https://github.com/kubernetes/kubernetes/issues/27984","id":162038253,"number":27984,"title":"Clarifying API guarantees of informer","user":{"login":"hongchaodeng","id":920884,"avatar_url":"https://avatars.githubusercontent.com/u/920884?v=3","gravatar_id":"","url":"https://api.github.com/users/hongchaodeng","html_url":"https://github.com/hongchaodeng","followers_url":"https://api.github.com/users/hongchaodeng/followers","following_url":"https://api.github.com/users/hongchaodeng/following{/other_user}","gists_url":"https://api.github.com/users/hongchaodeng/gists{/gist_id}","starred_url":"https://api.github.com/users/hongchaodeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hongchaodeng/subscriptions","organizations_url":"https://api.github.com/users/hongchaodeng/orgs","repos_url":"https://api.github.com/users/hongchaodeng/repos","events_url":"https://api.github.com/users/hongchaodeng/events{/privacy}","received_events_url":"https://api.github.com/users/hongchaodeng/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/CSI-API%20Machinery%20SIG","name":"team/CSI-API Machinery SIG","color":"d2b48c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-06-23T22:31:29Z","updated_at":"2016-07-04T09:46:55Z","closed_at":null,"body":"As one shared informer will be depended on by many controllers, it becomes more and more important to make informer reliable and easy to reason about. Therefore, we create this issue to collect all assumptions and try to provide clear guarantees and easy reasoning of informer APIs.\r\n\r\nAs first step, here are a list of API guarantees that we need to clarify:\r\n- Delivery of events from informer handler.\r\n  - **Is event ordering sequential?** In [SharedInformer.AddEventHandler()][1] it says “events to a single handler are delivered sequentially”. Currently DeltaFIFO is a keymap queue with undocumented priority and optional overriding . AFAIK, no compression (overriding) is done on DeltaFIFO in informer and there will be as many events in keymap queue as normal FIFO queue. What's the guaranteed of the queue? What’s the guarantee of event delivery to informer handler?\r\n  - **Are operations and event delivery atomic?** During resync, there might be other operations happening, aka Relist, Add, Update, Delete. Are they guaranteed to be atomic? For example, in relist and resync, it will iterate the store and there will be many events sent. During that, is the store allowed to process events and can the queue take other events?\r\n  - **What’s delivery semantics?** Exactly once? At least once? More than once?\r\n\r\n- In shared informer, each handler has its queuing of events. But the queuing shouldn’t be infinite. We should kill it before one OOM and takes down other informer users. @deads2k\r\n  - When should we kill it? How many items should we say the queue is too long?\r\n  - If a user is killed and tries to rejoin, what states should he get?\r\n\r\n- Is Informer readonly to user?\r\n  - Requeue() is known to be problematic (#27790) and even make changes to informer from user. Why do we need Requeue()? Is informer guaranteed to be readonly?\r\n\r\nOf course, there will be more questions coming through as we are making progress in different areas. We could coordinate API guarantees here and make informer as clarified as possible.\r\n\r\n[1]:https://github.com/kubernetes/kubernetes/blob/308201acb0e1515dab33b015c05ca31e40662aa0/pkg/controller/framework/shared_informer.go#L38\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/230250777","html_url":"https://github.com/kubernetes/kubernetes/issues/27984#issuecomment-230250777","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/27984","id":230250777,"user":{"login":"wojtek-t","id":10743879,"avatar_url":"https://avatars.githubusercontent.com/u/10743879?v=3","gravatar_id":"","url":"https://api.github.com/users/wojtek-t","html_url":"https://github.com/wojtek-t","followers_url":"https://api.github.com/users/wojtek-t/followers","following_url":"https://api.github.com/users/wojtek-t/following{/other_user}","gists_url":"https://api.github.com/users/wojtek-t/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtek-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtek-t/subscriptions","organizations_url":"https://api.github.com/users/wojtek-t/orgs","repos_url":"https://api.github.com/users/wojtek-t/repos","events_url":"https://api.github.com/users/wojtek-t/events{/privacy}","received_events_url":"https://api.github.com/users/wojtek-t/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T09:46:55Z","updated_at":"2016-07-04T09:46:55Z","body":">\r\nI recommend writing tests demonstrating (lack of?) desired behaviors.\r\n\r\n+100"}}
{"actor":{"display_login":"wojtek-t"}}