Skip to content

Rendering glitches when a workspace is stopped while ssh connection is alive #98

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

Closed
fioan89 opened this issue Apr 28, 2025 · 1 comment · Fixed by #102
Closed

Rendering glitches when a workspace is stopped while ssh connection is alive #98

fioan89 opened this issue Apr 28, 2025 · 1 comment · Fixed by #102
Assignees

Comments

@fioan89
Copy link
Collaborator

fioan89 commented Apr 28, 2025

This issue reproduces with Toolbox 2.6.1. Steps to reproduce:

  1. Open up Toolbox
  2. Connect to a running workspace
  3. Hit Stop from the hamburger menu
  4. Click somewhere else on the desktop to hide the Toolbox widget.

After a few seconds click on the Toolbox icon. Flickers start to appear, and Toolbox refuses to open. A restart for Toolbox is needed to fix the flickerings.

2.6.1.40902 81495 2025-04-26 01:30:17.653 INFO  -EventQueue-0 TrayWidget                Show widget request. Descriptor info: null
2.6.1.40902 81495 2025-04-26 01:30:17.653 INFO  -EventQueue-0 TrayWidget                Creating new widget
2.6.1.40902 81495 2025-04-26 01:30:17.653 INFO  -EventQueue-0 ComposeWindowManager      Show window request. Window: Toolbox, type: WINDOW
2.6.1.40902 81495 2025-04-26 01:30:17.704 INFO  cher-worker-9 DiskUsageManagerImpl      Calculating directory size at /Users/ifaur/Library/Caches/JetBrains/Toolbox/download
2.6.1.40902 81495 2025-04-26 01:30:17.705 INFO  -EventQueue-0 DialogHostKt              Received dialog: null
2.6.1.40902 81495 2025-04-26 01:30:17.705 INFO  cher-worker-9 DiskUsageManagerImpl      Calculating directory size at /Users/ifaur/Library/Caches/JetBrains/Toolbox/download done: 556 MB
2.6.1.40902 81495 2025-04-26 01:30:17.710 INFO  cher-worker-9 ApplicationManagerImpl    Refreshing feed on window open
2.6.1.40902 81495 2025-04-26 01:30:17.739 ERROR -EventQueue-0 ComposeWindowsService     Unhandled exception in a window 'Toolbox': java.lang.ClassCastException: class com.jetbrains.toolbox.api.remoteDev.states.EnvironmentDescription$General cannot be cast to class com.jetbrains.toolbox.api.remoteDev.states.EnvironmentDescription$Error (com.jetbrains.toolbox.api.remoteDev.states.EnvironmentDescription$General and com.jetbrains.toolbox.api.remoteDev.states.EnvironmentDescription$Error are in unnamed module of loader java.net.URLClassLoader @1e643faf)
	at com.jetbrains.toolbox.ui.views.GatewayEnvironmentViewKt$GatewayEnvironmentView$1$2$3$1.invokeSuspend(GatewayEnvironmentView.kt:383)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at androidx.compose.ui.platform.FlushCoroutineDispatcher$dispatch$2$1.invoke(FlushCoroutineDispatcher.skiko.kt:62)
	at androidx.compose.ui.platform.FlushCoroutineDispatcher$dispatch$2$1.invoke(FlushCoroutineDispatcher.skiko.kt:57)
	at androidx.compose.ui.platform.FlushCoroutineDispatcher.performRun(FlushCoroutineDispatcher.skiko.kt:105)
	at androidx.compose.ui.platform.FlushCoroutineDispatcher.access$performRun(FlushCoroutineDispatcher.skiko.kt:35)
	at androidx.compose.ui.platform.FlushCoroutineDispatcher$dispatch$2.invokeSuspend(FlushCoroutineDispatcher.skiko.kt:57)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Screen.Recording.2025-04-26.at.01.22.56.mov
@fioan89
Copy link
Collaborator Author

fioan89 commented Apr 28, 2025

This exception might be caused by the fact that we don't try to gracefully stop the ssh connection first.

@fioan89 fioan89 self-assigned this May 1, 2025
fioan89 added a commit that referenced this issue May 2, 2025
… while an SSH connection is alive.

Toolbox raises a class cast exception when Workspaces are stopped while
the SSH connection is running. After the workspace was stopped Toolbox
refused to show widget with some weird glitches on the screen.
The fix in this case is to safely disconnect the SSH before sending the
stop command to the workspace. The code will wait at most 10 seconds for
the disconnect to happen, and only after that send the stop.

- resolves #98
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 a pull request may close this issue.

1 participant