glsp icon indicating copy to clipboard operation
glsp copied to clipboard

GLSP Server Error when closing GLSP Eclipse Editor

Open jfaltermeier opened this issue 3 years ago • 0 comments

In rare cases the GLSP Eclipse Editor may throw exceptions when it gets closed:

ksnip_20220223-125444

Stacktrace:

!ENTRY org.eclipse.glsp.ide.editor 4 0 2022-02-23 12:53:46.837
!MESSAGE [GLSP-Server] Could not process message:ActionMessage [action=serverStatus, clientId=workflow_Editor_1]
Optional[Could not retrieve GLSP Editor. GLSP editor is not properly configured for clientId: workflow_Editor_1
org.eclipse.glsp.server.types.GLSPServerException: Could not retrieve GLSP Editor. GLSP editor is not properly configured for clientId: workflow_Editor_1
	at org.eclipse.glsp.server.types.GLSPServerException.getOrThrow(GLSPServerException.java:58)
	at org.eclipse.glsp.ide.editor.GLSPEditorRegistry.getGLSPEditorOrThrow(GLSPEditorRegistry.java:81)
	at org.eclipse.glsp.ide.editor.actions.handlers.IdeServerStatusActionHandler.executeAction(IdeServerStatusActionHandler.java:35)
	at org.eclipse.glsp.ide.editor.actions.handlers.IdeServerStatusActionHandler.executeAction(IdeServerStatusActionHandler.java:1)
	at org.eclipse.glsp.server.actions.AbstractActionHandler.execute(AbstractActionHandler.java:53)
	at org.eclipse.glsp.server.internal.actions.DefaultActionDispatcher.runAction(DefaultActionDispatcher.java:191)
	at org.eclipse.glsp.ide.editor.di.IdeActionDispatcher.runAction(IdeActionDispatcher.java:64)
	at org.eclipse.glsp.server.internal.actions.DefaultActionDispatcher.handleAction(DefaultActionDispatcher.java:170)
	at org.eclipse.glsp.server.internal.actions.DefaultActionDispatcher.handleNextAction(DefaultActionDispatcher.java:157)
	at org.eclipse.glsp.server.internal.actions.DefaultActionDispatcher.runThread(DefaultActionDispatcher.java:144)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.NoSuchElementException: No value present
	at java.base/java.util.Optional.get(Optional.java:148)
	at org.eclipse.glsp.server.types.GLSPServerException.getOrThrow(GLSPServerException.java:56)
	... 10 more
]

This seems to be a threading issue. One way which with it can be reproduced 100% is when you adjust the workflow-webapp to spam the serverStatus:

    const logAction = {
        kind: 'serverStatus',
        severity: 'INFO',
        message: 'I am an information'
    };
    setInterval((() => actionDispatcher.dispatch(logAction)), 10);

A few of these actions will be answered after the editor was already closed leading to the exceptions.

This may get caused by other Actions as well.

jfaltermeier avatar Feb 23 '22 12:02 jfaltermeier