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

Use debounce for pod scanning #153

Merged
merged 1 commit into from
Oct 26, 2020
Merged

Use debounce for pod scanning #153

merged 1 commit into from
Oct 26, 2020

Conversation

dobesv
Copy link
Contributor

@dobesv dobesv commented Oct 20, 2020

Instead of syncing the pod list for a service at most once every 10 minutes, apply a debounce on
changes so that we don't sync the pods list unless the service has been stable for 5 seconds or it has been more than 5 minutes since the last sync.

This should help avoid cases where pods are restarted and kubefwd doesn't seem to allow connecting to them any more, because it will sync pods more often than before.

Note I had previously made a PR for this exact change, which was merged, but most of the changes were lost in a later merge, maybe due to merge conflicts or somesuch.

Instead of syncing the pod list for a service at most once every 10 minutes, apply a debounce on
changes so that we don't sync the pods list unless the service has been stable for 5 seconds or it has been more than 5 minutes since the last sync.

This should help avoid cases where pods are restarted and kubefwd doesn't seem to allow connecting to them any more, because it will sync pods more often than before.
@cjimti
Copy link
Member

cjimti commented Oct 22, 2020

@dobesv thanks I'll review this soon

@cjimti
Copy link
Member

cjimti commented Oct 26, 2020

@dobesv I have been testing this and noticing that my forwards seem to resync all services on occation when no pods have gone offline, this disrupts my work. We may need a better way of detecting a failure (or I need a better way of testing this).

@dobesv
Copy link
Contributor Author

dobesv commented Oct 26, 2020

Hmm I wonder if I accidentally reverted some of your changes when I merged them into this PR.

@cjimti
Copy link
Member

cjimti commented Oct 26, 2020

@dobesv I am looking into a problem with IP assignements on headless services. Once I clear that up I think this PR should be good.

@dobesv
Copy link
Contributor Author

dobesv commented Oct 26, 2020

OK, let me know if you need my help with anything.

@cjimti cjimti merged commit 74ce0fa into txn2:master Oct 26, 2020
@cjimti
Copy link
Member

cjimti commented Oct 26, 2020

@dobesv the whole service registry system has been problematic. Now when SyncPodForwards runs it tries to re-bind ports on the running services, which it can not and then removes the service. I don't think it has to do with your debounce but I don't see how to make this registry work properly. I might disable the sync since the new version basicaly becomes unusable to me after the re-sync interval.

@dobesv dobesv deleted the debounce-again branch August 31, 2023 22:31
D3-LucaPiombino pushed a commit to CodeCoil/kubefwd that referenced this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants