diff --git a/launcher/pom.xml b/launcher/pom.xml index 146eeb5a5..e2aeeefc0 100644 --- a/launcher/pom.xml +++ b/launcher/pom.xml @@ -8,14 +8,14 @@ 21 21 1.0-SNAPSHOT - 0.26.3+4-f7ff164e+20231115-1742-SNAPSHOT - 0.26.3+4-f7ff164e+20231115-1744-SNAPSHOT - 0.26.3+4-f7ff164e+20231115-1744-SNAPSHOT + 0.27.0+0-11cabe5f+20231117-0739-SNAPSHOT + 0.27.0+0-11cabe5f+20231117-0741-SNAPSHOT + 0.27.0+0-11cabe5f+20231117-0741-SNAPSHOT com.raw-labs.com raw-launcher - 0.26.3+4-f7ff164e+20231115-1744-SNAPSHOT + 0.27.0+0-11cabe5f+20231117-0741-SNAPSHOT diff --git a/snapi-client/src/main/scala/raw/client/rql2/truffle/Rql2TruffleCompilerService.scala b/snapi-client/src/main/scala/raw/client/rql2/truffle/Rql2TruffleCompilerService.scala index 96448ce1b..7ccf4a305 100644 --- a/snapi-client/src/main/scala/raw/client/rql2/truffle/Rql2TruffleCompilerService.scala +++ b/snapi-client/src/main/scala/raw/client/rql2/truffle/Rql2TruffleCompilerService.scala @@ -198,8 +198,18 @@ class Rql2TruffleCompilerService(maybeClassLoader: Option[ClassLoader] = None)( EvalSuccess(rawValue) } catch { case ex: PolyglotException => + // (msb): The following are various "hacks" to ensure the inner language InterruptException propagates "out". + // Unfortunately, I do not find a more reliable alternative; the branch that does seem to work is the one + // that does startsWith. That said, I believe with Truffle, the expectation is that one is supposed to + // "cancel the context", but in our case this doesn't quite match the current architecture, where we have + // other non-Truffle languages and also, we have parts of the pipeline that are running outside of Truffle + // and which must handle interruption as well. if (ex.isInterrupted) { throw new InterruptedException() + } else if (ex.getCause.isInstanceOf[InterruptedException]) { + throw ex.getCause + } else if (ex.getMessage.startsWith("java.lang.InterruptedException")) { + throw new InterruptedException() } else if (ex.isGuestException) { val err = ex.getGuestObject if (err != null && err.hasMembers && err.hasMember("errors")) { @@ -363,8 +373,18 @@ class Rql2TruffleCompilerService(maybeClassLoader: Option[ClassLoader] = None)( } } catch { case ex: PolyglotException => + // (msb): The following are various "hacks" to ensure the inner language InterruptException propagates "out". + // Unfortunately, I do not find a more reliable alternative; the branch that does seem to work is the one + // that does startsWith. That said, I believe with Truffle, the expectation is that one is supposed to + // "cancel the context", but in our case this doesn't quite match the current architecture, where we have + // other non-Truffle languages and also, we have parts of the pipeline that are running outside of Truffle + // and which must handle interruption as well. if (ex.isInterrupted) { throw new InterruptedException() + } else if (ex.getCause.isInstanceOf[InterruptedException]) { + throw ex.getCause + } else if (ex.getMessage.startsWith("java.lang.InterruptedException")) { + throw new InterruptedException() } else if (ex.isGuestException) { val err = ex.getGuestObject if (err != null && err.hasMembers && err.hasMember("errors")) {