Open madoar opened 5 years ago
Can you check if this is only for verbs? I would assume that you get the same behavior for all downloads. Maybe even if you abort any installation in general.
I think the exception is the way we interrupt a script, isn't it?
If it is then it should be caught somewhere.
@qparis could you explain how exactly the interrupt works? I see that AbstractStepRepresentation
calls messageWaitingForResponse.sendCancelSignal()
which uses Message
and UiMessageSenderJavaFXImplementation
to interrupt the thread. What I do not get is how this should lead to the ScriptException
caught in VerbsManager#installVerb
. Right now, a PolyglotException
is thrown (which is certainly not caught in that try catch block).
On the latest commit I get a slightly different error message than OP.
[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - java.lang.InterruptedException
at org.phoenicis.scripts.ui.Message.block(Message.java:35)
at org.phoenicis.scripts.ui.UiMessageSender.runAndWait(UiMessageSender.java:33)
at org.phoenicis.scripts.wizard.UiSetupWizardImplementation.presentation(UiSetupWizardImplementation.java:160)
at <js> go(Unnamed:25:857-947)
at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
at com.sun.proxy.$Proxy66.go(Unknown Source)
at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:237)
at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by host exception: org.phoenicis.scripts.exceptions.ScriptException: java.lang.InterruptedException
[WARNING]
org.graalvm.polyglot.PolyglotException: java.lang.InterruptedException
at org.phoenicis.scripts.ui.Message.block (Message.java:35)
at org.phoenicis.scripts.ui.UiMessageSender.runAndWait (UiMessageSender.java:33)
at org.phoenicis.scripts.wizard.UiSetupWizardImplementation.presentation (UiSetupWizardImplementation.java:160)
at <js>.go (Unnamed:25)
at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke (HostInteropReflect.java:678)
at com.sun.proxy.$Proxy66.go (Unknown Source)
at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7 (ApplicationInformationPanelSkin.java:237)
at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
at java.lang.Thread.run (Thread.java:834
Also happens when cancelling an installer.
Could be due to updated GraalVM.
I think the question is where should we catch the exception? I agree that interrupting the thread executing the script is a valid decision. The problem is where should we detect this and what is the correct handling of such an exception?
I'm not really sure. I would like to get @qparis input regarding this.
@qparis we need your opinion on this
To be honest I do not remember 😊
I’ll investigate this evening
Interrupting the installation of a Verb during the download phase, via a click on the
Cancel
button, results in an exception: