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

When using sandbox the editor is freezing for a few seconds on startup #613

Closed
adietish opened this issue Jun 6, 2023 · 2 comments · Fixed by #624
Closed

When using sandbox the editor is freezing for a few seconds on startup #613

adietish opened this issue Jun 6, 2023 · 2 comments · Fixed by #624
Assignees
Labels
kind/bug Something isn't working severity/major
Milestone

Comments

@adietish
Copy link
Collaborator

adietish commented Jun 6, 2023

Steps:

  1. EXEC: have Red Hat Sandbox as current cluster
  2. EXEC: create the quarkus kubernetes-quickstart app
quarkus create app org.acme:kubernetes-quickstart \
    --extension='resteasy-reactive,kubernetes,jib'
  1. EXEC: run ./mvnw clean package
  2. EXEC: import it into intellij
  3. EXEC: open the k8 resource file target/kubernetes/openshift.yml in an editor
  4. EXEC: scroll around until the editor is freezing

Result:
At some point the editor is freezing for a few seconds (maybe 4s) before it displays the notification

@adietish adietish added kind/bug Something isn't working severity/major labels Jun 6, 2023
@adietish adietish added this to the Backlog milestone Jun 6, 2023
@adietish adietish self-assigned this Jun 28, 2023
@adietish adietish moved this to 📋 Backlog in IDE Cloudaptors Jun 28, 2023
@adietish adietish moved this from 📋 Backlog to 🏗 In progress in IDE Cloudaptors Jun 29, 2023
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jun 30, 2023
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jun 30, 2023
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jun 30, 2023
@adietish
Copy link
Collaborator Author

adietish commented Jun 30, 2023

The freeze is caused by PushNotification#show that calls EditorResource#getState to see if a resource is New or Modified when compared to the cluster. The push notification displays "Push to create resource X?" for a new resource while it shows "Push to update resource X?" for a resource that exists on the cluster but was modified in the editor. EditorResource#getState reaches out to the cluster in order to determine if a resource is new or modified. The problem is that PushNotification#show is executed in the UI thread and is therefore freezing the UI thread.

@adietish
Copy link
Collaborator Author

adietish commented Jun 30, 2023

The freeze can only be experienced when using the Red Hat Developer Sandbox (or any remote cluster) and when using a multi-resource document like the document pasted below. It is generated when https://github.com/adietish/openshift-quickstart is built (mvn clean package) or when the project is scaffolded with the quarkus command line shown above.

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    app.openshift.io/vcs-url: <<unknown>>
    app.quarkus.io/build-timestamp: 2023-06-30 - 12:24:49 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.kubernetes.io/managed-by: quarkus
    app.openshift.io/runtime: quarkus
  name: openshift-quickstart
spec:
  ports:
    - name: https
      port: 443
      protocol: TCP
      targetPort: 8443
    - name: http
      port: 80
      protocol: TCP
      targetPort: 8080
  selector:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  type: ClusterIP
---
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  annotations:
    app.openshift.io/vcs-url: <<unknown>>
    app.quarkus.io/build-timestamp: 2023-06-30 - 12:24:49 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.kubernetes.io/managed-by: quarkus
    app.openshift.io/runtime: quarkus
  name: openshift-quickstart
spec:
  dockerImageRepository: docker.io/adietish/openshift-quickstart
  lookupPolicy:
    local: true
---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  annotations:
    app.openshift.io/vcs-url: <<unknown>>
    app.quarkus.io/build-timestamp: 2023-06-30 - 12:24:49 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.kubernetes.io/managed-by: quarkus
    app.openshift.io/runtime: quarkus
  name: openshift-quickstart
spec:
  replicas: 1
  selector:
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.kubernetes.io/name: openshift-quickstart
  template:
    metadata:
      annotations:
        app.openshift.io/vcs-url: <<unknown>>
        app.quarkus.io/build-timestamp: 2023-06-30 - 12:24:49 +0000
      labels:
        app.kubernetes.io/managed-by: quarkus
        app.openshift.io/runtime: quarkus
        app.kubernetes.io/version: 1.0.0-SNAPSHOT
        app.kubernetes.io/name: openshift-quickstart
    spec:
      containers:
        - env:
            - name: KUBERNETES_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          image: openshift-quickstart:1.0.0-SNAPSHOT
          imagePullPolicy: Always
          name: openshift-quickstart
          ports:
            - containerPort: 8443
              name: https
              protocol: TCP
            - containerPort: 8080
              name: http
              protocol: TCP
  triggers:
    - imageChangeParams:
        automatic: true
        containerNames:
          - openshift-quickstart
        from:
          kind: ImageStreamTag
          name: openshift-quickstart:1.0.0-SNAPSHOT
      type: ImageChange
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  annotations:
    app.openshift.io/vcs-url: <<unknown>>
    app.quarkus.io/build-timestamp: 2023-06-30 - 12:24:49 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.kubernetes.io/managed-by: quarkus
    app.openshift.io/runtime: quarkus
  name: openshift-quickstart
spec:
  port:
    targetPort: http
  to:
    kind: Service
    name: openshift-quickstart

adietish added a commit to adietish/intellij-kubernetes that referenced this issue Jun 30, 2023
@adietish adietish moved this from 🏗 In progress to 👀 In review in IDE Cloudaptors Jul 1, 2023
adietish added a commit that referenced this issue Jul 4, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDE Cloudaptors Jul 4, 2023
@adietish adietish modified the milestones: Backlog, 1.1.0 Jul 25, 2023
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 severity/major
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant