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

fix cache quest lock condition #35

Merged
merged 2 commits into from
Feb 4, 2024
Merged

Conversation

self-transition
Copy link
Member

@self-transition self-transition commented Feb 1, 2024

In the previous PR #34, we added a synchronization lock to globalStore.get() to ensure that only one valid http(s) and wbsocket(s) request is sent for the same resource concurrently, but the lock is not sufficiently restrictive: the lock is only added if the request parameters are identical, for the following reason:

  • The parameters passed to the dataprovider by the caller will only be used inside the dataprovider and not sent to the k8s api server, the actual request parameters sent to the api server should be determined by the dataprovider.
  • In one globalstore instance, we should strictly ensure that only one list watch exists for a resource at a time, otherwise there will be unintended consequences.

This PR also adds the cancelquery logic that was missing: when the websocket readyState is CONNECTING, the connection should also be closed.

Copy link

@huangjunjia huangjunjia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@tanbowensg tanbowensg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@self-transition self-transition merged commit af065fe into main Feb 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants