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 current Namespace/Project has a bug with minikube #640

Closed
olkornii opened this issue Jul 24, 2023 · 7 comments · Fixed by #641
Closed

Use current Namespace/Project has a bug with minikube #640

olkornii opened this issue Jul 24, 2023 · 7 comments · Fixed by #641
Assignees
Labels
kind/bug Something isn't working

Comments

@olkornii
Copy link
Collaborator

Configurations:
Kubernetes v1.26.2 on Docker 24.0.4
openjdk 17.0.7 2023-04-18
OS: Fedora 38
Intellij 2023.1

Steps to reproduce:

  1. Start minikube cluster
  2. Expand Namespaces
  3. Select namespace -> right click -> Use namespace -> tree refreshed (WRONG BEHAVIOR)
  4. Repeat few times -> cluster name changes for short time (sometimes freezes)

On the video's 10 second is a bug.
Screencast from 2023-07-24 12-22-10.webm

@olkornii olkornii added the kind/bug Something isn't working label Jul 24, 2023
@adietish
Copy link
Collaborator

I cannot replicate this, I'm running MacOS though which may interfere.

adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jul 24, 2023
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jul 24, 2023
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jul 24, 2023
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jul 24, 2023
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jul 24, 2023
adietish added a commit that referenced this issue Jul 24, 2023
adietish added a commit that referenced this issue Jul 24, 2023
@adietish
Copy link
Collaborator

#641 prevents minikube from being displayed as <unknown context>. It does not fix the collapsing of the context though. I thus keep this issue opened.

@adietish adietish reopened this Jul 24, 2023
adietish added a commit that referenced this issue Jul 24, 2023
@adietish adietish self-assigned this Jul 25, 2023
@adietish
Copy link
Collaborator

adietish commented Jul 25, 2023

It looks as if the reason for the remaining bug is that the file watcher service in the jdk would send multiple (2+) events per file for a single modification. Several reports of this exist on stackoverflow:

This only happens on Linux (and maybe Windows), not on MacOS where the file watcher service isn't native (it's polling in java).

A possible solution is to check the file timestamp and ignore subsequent notification for the same file for the same timestamp (see comment in https://java.tutorialink.com/java-7-watchservice-ignoring-multiple-occurrences-of-the-same-event/)

@adietish
Copy link
Collaborator

There is a filewatcher service that is native & cross-platform. It provides a native implementation for MacOS: https://github.com/gmethvin/directory-watcher/blob/main/core/src/main/java/io/methvin/watchservice/MacOSXListeningWatchService.java

@adietish
Copy link
Collaborator

depends on redhat-developer/intellij-common#190

datho7561 added a commit to datho7561/intellij-common that referenced this issue Jul 25, 2023
I'm not convinced this is doing much to address
redhat-developer/intellij-kubernetes#640.
In practice, the first few times I attempt to switch namespaces,
the tree collapses, regardless of if I use this PR or the existing code.
After that, I can occasionally switch namespaces without the tree
collapsing.

See redhat-developer#190.

Signed-off-by: David Thompson <[email protected]>
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jul 26, 2023
adietish added a commit that referenced this issue Jul 26, 2023
@adietish
Copy link
Collaborator

adietish commented Jul 26, 2023

#646 improved the situation. Minikube resource tree is still collapsing though but it is doing it less frequently. There's not much more we can do about this given that it's the jdk filesystem watch service that is causing this when notifying a single file change multiple times.

@adietish
Copy link
Collaborator

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants