[JBoss JIRA] (ISPN-6673) Implement Rolling Upgrades with Kubernetes
by Sebastian Łaskawiec (JIRA)
Sebastian Łaskawiec created ISPN-6673:
-----------------------------------------
Summary: Implement Rolling Upgrades with Kubernetes
Key: ISPN-6673
URL: https://issues.jboss.org/browse/ISPN-6673
Project: Infinispan
Issue Type: Feature Request
Components: Cloud Integrations
Reporter: Sebastian Łaskawiec
Assignee: Sebastian Łaskawiec
Currently Kubernetes Rolling Upgrades might damage the cluster and cause data loss. The only way to avoid that is to use a Cache Store.
We should instrument the Rolling Upgrades mechanism and indicate when it is safe to scale the cluster in.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (ISPN-6173) NotSerializableException while executing streams via JavaScript in a cluster in DIST mode
by Anna Manukyan (JIRA)
[ https://issues.jboss.org/browse/ISPN-6173?page=com.atlassian.jira.plugin.... ]
Anna Manukyan commented on ISPN-6173:
-------------------------------------
[~galder.zamarreno] thanks a lot for the explanation.
>From my understanding, when passing the flag {{Flag.CACHE_MODE_LOCAL}} for the REPL/DIST cache, the system runs this script only on specified cacheManager (connected to concrete server) and is passing, because it behaves in the same way like executing the `wordStream.js` script on LOCAL cache. But if you will remove the flag, then you can see that the same script will fail (with mode=local) with exception:
{code}
Caused by: an exception which occurred:
in field apply
in object org.infinispan.util.function.SerializableFunction$$NashornJavaAdapter@7bb35cc6
-> toString = org.infinispan.util.function.SerializableFunction$$NashornJavaAdapter@7bb35cc6
in object java.util.ArrayDeque@640dc4c6
-> toString = [org.infinispan.stream.impl.intops.object.MapOperation@4b54af3d, org.infinispan.stream.impl.intops.object.MapOperation@610df783, org.infinispan.stream.impl.intops.object.MapOperation@f3fcd59, org.infinispan.stream.impl.intops.object.FlatMapOperation@2b56f5f8]
in object org.infinispan.stream.impl.termop.SegmentRetryingOperation@2c6ee758
-> toString = org.infinispan.stream.impl.termop.SegmentRetryingOperation@2c6ee758
in object org.infinispan.stream.impl.StreamRequestCommand@76d05cc9
-> toString = StreamRequestCommand{cacheName='___defaultcache'}
{code}
On the other hand, if you will pass the same flag for executing the `wordCountStream_serializable.js` file, then it will pass.
I would like to point out one more thing: Will has implemented ISPN-6074 which doesn't require the dist. executors to be run on DIST cache (it does it in the background - retrieves all info, etc.). The `wordCountStream_Exec.js` indicates that scenario, where the {{mode=local}}, but the task is submitted with {{cacheManager.executor().submitConsumer(...)}}, and the issue still appears.
> NotSerializableException while executing streams via JavaScript in a cluster in DIST mode
> -----------------------------------------------------------------------------------------
>
> Key: ISPN-6173
> URL: https://issues.jboss.org/browse/ISPN-6173
> Project: Infinispan
> Issue Type: Bug
> Reporter: Anna Manukyan
> Assignee: Galder Zamarreño
> Fix For: 9.0.0.Alpha3, 9.0.0.Final
>
> Attachments: wordCountStream_Exec.js
>
>
> The following exception appears when I try to execute a JS script which uses Java Stream API on 4 node cluster in DIST_SYNC mode. No matter which mode is set in JS metadata (local or distributed) the test ends with exception.
> You can find the test and the script here:
> https://github.com/andyuk1986/infinispan/blob/2e19b65a00d962201c81216ca3b...
> https://github.com/andyuk1986/infinispan/blob/2e19b65a00d962201c81216ca3b...
> When the mode=local, the exception is:
> {code}
> org.infinispan.commons.marshall.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_LL
> Caused by: an exception which occurred:
> in field apply
> in object jdk.nashorn.javaadapters.java.util.function.Function$$Serializable@5e828108
> -> toString = jdk.nashorn.javaadapters.java.util.function.Function$$Serializable@5e828108
> in object java.util.ArrayDeque@7074aba7
> -> toString = [org.infinispan.stream.impl.intops.object.MapOperation@11cc7142]
> in object org.infinispan.stream.impl.termop.SegmentRetryingOperation@70414f65
> -> toString = org.infinispan.stream.impl.termop.SegmentRetryingOperation@70414f65
> in object org.infinispan.stream.impl.StreamRequestCommand@38614d0c
> -> toString = StreamRequestCommand{cacheName='___defaultcache'}
> {code}
> When the mode=distributed, the exception is:
> {code}
> java.util.concurrent.ExecutionException: java.util.concurrent.CancellationException
> at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
> at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
> at org.infinispan.scripting.DistributedCacheScriptingTest.testDistributedMapReduceStream(DistributedCacheScriptingTest.java:61)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
> at org.testng.TestRunner.privateRun(TestRunner.java:767)
> at org.testng.TestRunner.run(TestRunner.java:617)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
> at org.testng.SuiteRunner.access$000(SuiteRunner.java:38)
> at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:382)
> at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.util.concurrent.CancellationException
> at java.util.concurrent.CompletableFuture.cancel(CompletableFuture.java:2263)
> at org.infinispan.util.concurrent.CompletableFutures.lambda$toCompletableFuture$16(CompletableFutures.java:49)
> at org.infinispan.commons.util.concurrent.BaseNotifyingFuture.fireListeners(BaseNotifyingFuture.java:37)
> at org.infinispan.commons.util.concurrent.NotifyingFutureImpl.notifyException(NotifyingFutureImpl.java:105)
> at org.infinispan.distexec.DefaultExecutorService$LocalDistributedTaskPart$1.doLocalInvoke(DefaultExecutorService.java:1117)
> at org.infinispan.distexec.DefaultExecutorService$LocalDistributedTaskPart$1.call(DefaultExecutorService.java:1103)
> ... 4 more
> {code}
> But for both cases, from the TRACE logs the real exception is:
> {code}
> java.io.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_LL
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.infinispan.stream.impl.intops.IntermediateOperationExternalizer.writeObject(IntermediateOperationExternalizer.java:194) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.intops.IntermediateOperationExternalizer.writeObject(IntermediateOperationExternalizer.java:23) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.core.ExternalizerTable$ExternalizerAdapter.writeObject(ExternalizerTable.java:481) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:138) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:569) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.infinispan.stream.impl.termop.TerminalOperationExternalizer.writeObject(TerminalOperationExternalizer.java:83) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.termop.TerminalOperationExternalizer.writeObject(TerminalOperationExternalizer.java:34) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.core.ExternalizerTable$ExternalizerAdapter.writeObject(ExternalizerTable.java:481) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:138) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeCommandParameters(ReplicableCommandExternalizer.java:66) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.marshallParameters(CacheRpcCommandExternalizer.java:128) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.writeObject(CacheRpcCommandExternalizer.java:112) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.writeObject(CacheRpcCommandExternalizer.java:68) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.core.ExternalizerTable$ExternalizerAdapter.writeObject(ExternalizerTable.java:481) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:138) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.objectToObjectStream(AbstractJBossMarshaller.java:72) ~[infinispan-commons-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.core.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:77) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.commons.marshall.AbstractMarshaller.objectToBuffer(AbstractMarshaller.java:41) [infinispan-commons-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.commons.marshall.AbstractDelegatingMarshaller.objectToBuffer(AbstractDelegatingMarshaller.java:85) [infinispan-commons-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.MarshallerAdapter.objectToBuffer(MarshallerAdapter.java:23) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.marshallCall(CommandAwareRpcDispatcher.java:247) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.processSingleCall(CommandAwareRpcDispatcher.java:265) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommand(CommandAwareRpcDispatcher.java:121) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotelyAsync(JGroupsTransport.java:578) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotelyAsync(RpcManagerImpl.java:162) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.ClusterStreamManagerImpl.submitAsyncTasks(ClusterStreamManagerImpl.java:169) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.ClusterStreamManagerImpl.commonRemoteStreamOperation(ClusterStreamManagerImpl.java:86) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.ClusterStreamManagerImpl.remoteStreamOperationRehashAware(ClusterStreamManagerImpl.java:70) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.AbstractCacheStream.performOperationRehashAware(AbstractCacheStream.java:306) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.AbstractCacheStream.performOperation(AbstractCacheStream.java:258) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.DistributedCacheStream.collect(DistributedCacheStream.java:329) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at jdk.nashorn.internal.scripts.Script$\^eval\_.:program(<eval>:23) [?:?]
> at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:640) [nashorn.jar:?]
> at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228) [nashorn.jar:?]
> at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) [nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:418) [nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.access$300(NashornScriptEngine.java:73) [nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:511) [nashorn.jar:?]
> at javax.script.CompiledScript.eval(CompiledScript.java:92) [?:1.8.0_66]
> at org.infinispan.scripting.impl.ScriptingManagerImpl.execute(ScriptingManagerImpl.java:182) [classes/:?]
> at org.infinispan.scripting.impl.DistributedScript.call(DistributedScript.java:30) [classes/:?]
> at org.infinispan.commands.read.DistributedExecuteCommand.perform(DistributedExecuteCommand.java:103) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.distexec.DefaultExecutorService$LocalDistributedTaskPart$1.doLocalInvoke(DefaultExecutorService.java:1113) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.distexec.DefaultExecutorService$LocalDistributedTaskPart$1.call(DefaultExecutorService.java:1103) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_66]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_66]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_66]
> at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
> Caused by: org.jboss.marshalling.TraceInformation
> {code}
> Seems that this is general Nashorn thing, as complex object serialization also gives the same exception. E.g the following script execution throws same exception with a bit different stack trace:
> {code}
> // mode=distributed,language=javascript
> var Function = Java.type("java.util.function.Function")
> var Serializable = Java.type("java.io.Serializable")
> var SerializableFunction = Java.extend(Function, Serializable);
> var CollectionsAndFiles = new JavaImporter(
> java.util,
> java.io,
> java.nio);
> var e = new SerializableFunction( {
> apply: function(object) {
> return object.getValue().toLowerCase().split(/[\\W]+/)
> }
> })
> with (CollectionsAndFiles) {
> var bos = new ByteArrayOutputStream();
> var out = null;
> try {
> out = new ObjectOutputStream(bos);
> out.writeObject(e);
> var yourBytes = bos.toByteArray();
> } finally {
> try {
> if (out != null) {
> out.close();
> }
> } finally {
> }
> }
> }
> {code}
> the stacktrace for the code above is:
> {code}
> java.lang.RuntimeException: java.io.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_LL
> at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:397) ~[nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:446) ~[nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:403) ~[nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:399) ~[nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155) ~[nashorn.jar:?]
> at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233) ~[?:1.8.0_66]
> at org.infinispan.scripting.impl.ScriptingManagerImpl.execute(ScriptingManagerImpl.java:186) ~[classes/:?]
> at org.infinispan.scripting.impl.DistributedScript.call(DistributedScript.java:30) ~[classes/:?]
> at org.infinispan.commands.read.DistributedExecuteCommand.perform(DistributedExecuteCommand.java:103) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.inboundhandler.BasePerCacheInboundInvocationHandler.invokePerform(BasePerCacheInboundInvocationHandler.java:92) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.inboundhandler.BaseBlockingRunnable.run(BaseBlockingRunnable.java:34) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_66]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_66]
> at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
> Caused by: java.io.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_LL
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) ~[?:1.8.0_66]
> at jdk.nashorn.internal.scripts.Script$2$\^eval\_.:program(<eval>:21) ~[?:?]
> at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:640) ~[nashorn.jar:?]
> at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228) ~[nashorn.jar:?]
> at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[nashorn.jar:?]
> ... 13 more
> {code}
> UPDATE:
> In case when the test tries to execute javascript where the mode is set to local, and the map/reduce is executed using submitConsumer(...) method of the cacheManager's executor, the following exception is thrown:
> {code}
> java.util.concurrent.CompletionException: java.lang.ClassCastException: Cannot cast org.infinispan.manager.DefaultCacheManager to java.util.function.Function
> org.infinispan.commons.marshall.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_L3
> Caused by: an exception which occurred:
> in field apply
> in object jdk.nashorn.javaadapters.java.util.function.Function$$Serializable@1ad8df52
> -> toString = jdk.nashorn.javaadapters.java.util.function.Function$$Serializable@1ad8df52
> in object org.infinispan.manager.impl.ReplicableCommandManagerFunction@a52ca2e
> -> toString = org.infinispan.manager.impl.ReplicableCommandManagerFunction@a52ca2e
> {code}
> The code is attached wordCountStream_Exec.js.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (ISPN-6672) Incorrect cache contents entries count
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-6672?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño updated ISPN-6672:
-----------------------------------
Steps to Reproduce:
1. Start docker
2. In docker terminal, run:
{{$ docker run -it --name master -h master -e "SLAVES=1" gustavonalle/infinispan-server-domain:9.0.0.Alpha2}}
3. Open new terminal and run:
{code}
$ eval $(/usr/local/bin/docker-machine env default)
$ docker run --name spark-master -ti gustavonalle/spark:1.6.0
{code}
4. Open new terminal and run:
{code}
$ eval $(/usr/local/bin/docker-machine env default)
$ docker exec -it spark-master /usr/local/spark/bin/spark-shell --master spark://172.17.0.3:7077 --packages org.infinispan:infinispan-spark_2.10:0.2 --conf spark.io.compression.codec=lz4
{code}
5. In the Scala terminal, type (you can copy paste it directly and it should work):
{code}
import org.infinispan.spark._
import org.infinispan.spark.rdd._
import scala.util.Random
val wordList = scala.io.Source.fromFile("/usr/share/dict/cracklib-words").getLines.foldLeft(List[String]())( (s, w) => w :: s)
val phrases = (0 to 400).toStream.map(i=>Random.nextInt(wordList.size)).sliding(4,4).map(_.map(wordList).mkString(" ")).toSeq
val phraseRDD = sc.parallelize(phrases).zipWithIndex.map(_.swap)
val config = new java.util.Properties
config.put("infinispan.client.hotrod.server_list","172.17.0.2:11222")
phraseRDD.writeToInfinispan(config)
{code}
6. Go to admin console in http://172.17.0.2:9990, and go to "Cache containers clustered default (Distributed, Sync, 2 owners )" and you'll see there's been 101 puts but the cache contents are only 50 in the "General Status" tab, even if there's only one node in the cluster. If you go to the "Nodes" tab, it shows "Total Entries" being 101 which is correct.
was:
1. Start docker
2. In docker terminal, run:
$ docker run -it --name master -h master -e "SLAVES=1" gustavonalle/infinispan-server-domain:9.0.0.Alpha2
3. Open new terminal and run:
$ eval $(/usr/local/bin/docker-machine env default)
$ docker run --name spark-master -ti gustavonalle/spark:1.6.0
4. Open new terminal and run:
$ eval $(/usr/local/bin/docker-machine env default)
$ docker exec -it spark-master /usr/local/spark/bin/spark-shell --master spark://172.17.0.3:7077 --packages org.infinispan:infinispan-spark_2.10:0.2 --conf spark.io.compression.codec=lz4
5. In the Scala terminal, type:
import org.infinispan.spark._
import org.infinispan.spark.rdd._
import scala.util.Random
val wordList = scala.io.Source.fromFile("/usr/share/dict/cracklib-words").getLines.foldLeft(List[String]())( (s, w) => w :: s)
val phrases = (0 to 400).toStream.map(i=>Random.nextInt(wordList.size)).sliding(4,4).map(_.map(wordList).mkString(" ")).toSeq
val phraseRDD = sc.parallelize(phrases).zipWithIndex.map(_.swap)
val config = new java.util.Properties
config.put("infinispan.client.hotrod.server_list","172.17.0.2:11222")
phraseRDD.writeToInfinispan(config)
6. Go to admin console in http://172.17.0.2:9990, and go to "Cache containers clustered default (Distributed, Sync, 2 owners )" and you'll see there's been 101 puts but the cache contents are only 50 in the "General Status" tab, even if there's only one node in the cluster. If you go to the "Nodes" tab, it shows "Total Entries" being 101 which is correct.
> Incorrect cache contents entries count
> --------------------------------------
>
> Key: ISPN-6672
> URL: https://issues.jboss.org/browse/ISPN-6672
> Project: Infinispan
> Issue Type: Bug
> Components: Console
> Affects Versions: 9.0.0.Alpha2, 8.2.2.Final
> Reporter: Galder Zamarreño
>
> "Cache Contents / Entries" field in management not correctly calculated. The screenshot should show 101 entries and not 50. See steps to reproduce.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (ISPN-6672) Incorrect cache contents entries count
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-6672?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño updated ISPN-6672:
-----------------------------------
Steps to Reproduce:
1. Start docker
2. In docker terminal, run:
{code}
$ docker run -it --name master -h master -e "SLAVES=1" gustavonalle/infinispan-server-domain:9.0.0.Alpha2
{code}
3. Open new terminal and run:
{code}
$ eval $(/usr/local/bin/docker-machine env default)
$ docker run --name spark-master -ti gustavonalle/spark:1.6.0
{code}
4. Open new terminal and run:
{code}
$ eval $(/usr/local/bin/docker-machine env default)
$ docker exec -it spark-master /usr/local/spark/bin/spark-shell --master spark://172.17.0.3:7077 --packages org.infinispan:infinispan-spark_2.10:0.2 --conf spark.io.compression.codec=lz4
{code}
5. In the Scala terminal, type (you can copy paste it directly and it should work):
{code}
import org.infinispan.spark._
import org.infinispan.spark.rdd._
import scala.util.Random
val wordList = scala.io.Source.fromFile("/usr/share/dict/cracklib-words").getLines.foldLeft(List[String]())( (s, w) => w :: s)
val phrases = (0 to 400).toStream.map(i=>Random.nextInt(wordList.size)).sliding(4,4).map(_.map(wordList).mkString(" ")).toSeq
val phraseRDD = sc.parallelize(phrases).zipWithIndex.map(_.swap)
val config = new java.util.Properties
config.put("infinispan.client.hotrod.server_list","172.17.0.2:11222")
phraseRDD.writeToInfinispan(config)
{code}
6. Go to admin console in http://172.17.0.2:9990, and go to "Cache containers clustered default (Distributed, Sync, 2 owners )" and you'll see there's been 101 puts but the cache contents are only 50 in the "General Status" tab, even if there's only one node in the cluster. If you go to the "Nodes" tab, it shows "Total Entries" being 101 which is correct.
was:
1. Start docker
2. In docker terminal, run:
{{$ docker run -it --name master -h master -e "SLAVES=1" gustavonalle/infinispan-server-domain:9.0.0.Alpha2}}
3. Open new terminal and run:
{code}
$ eval $(/usr/local/bin/docker-machine env default)
$ docker run --name spark-master -ti gustavonalle/spark:1.6.0
{code}
4. Open new terminal and run:
{code}
$ eval $(/usr/local/bin/docker-machine env default)
$ docker exec -it spark-master /usr/local/spark/bin/spark-shell --master spark://172.17.0.3:7077 --packages org.infinispan:infinispan-spark_2.10:0.2 --conf spark.io.compression.codec=lz4
{code}
5. In the Scala terminal, type (you can copy paste it directly and it should work):
{code}
import org.infinispan.spark._
import org.infinispan.spark.rdd._
import scala.util.Random
val wordList = scala.io.Source.fromFile("/usr/share/dict/cracklib-words").getLines.foldLeft(List[String]())( (s, w) => w :: s)
val phrases = (0 to 400).toStream.map(i=>Random.nextInt(wordList.size)).sliding(4,4).map(_.map(wordList).mkString(" ")).toSeq
val phraseRDD = sc.parallelize(phrases).zipWithIndex.map(_.swap)
val config = new java.util.Properties
config.put("infinispan.client.hotrod.server_list","172.17.0.2:11222")
phraseRDD.writeToInfinispan(config)
{code}
6. Go to admin console in http://172.17.0.2:9990, and go to "Cache containers clustered default (Distributed, Sync, 2 owners )" and you'll see there's been 101 puts but the cache contents are only 50 in the "General Status" tab, even if there's only one node in the cluster. If you go to the "Nodes" tab, it shows "Total Entries" being 101 which is correct.
> Incorrect cache contents entries count
> --------------------------------------
>
> Key: ISPN-6672
> URL: https://issues.jboss.org/browse/ISPN-6672
> Project: Infinispan
> Issue Type: Bug
> Components: Console
> Affects Versions: 9.0.0.Alpha2, 8.2.2.Final
> Reporter: Galder Zamarreño
>
> "Cache Contents / Entries" field in management not correctly calculated. The screenshot should show 101 entries and not 50. See steps to reproduce.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (ISPN-6672) Incorrect cache contents entries count
by Galder Zamarreño (JIRA)
Galder Zamarreño created ISPN-6672:
--------------------------------------
Summary: Incorrect cache contents entries count
Key: ISPN-6672
URL: https://issues.jboss.org/browse/ISPN-6672
Project: Infinispan
Issue Type: Bug
Components: Console
Affects Versions: 8.2.2.Final, 9.0.0.Alpha2
Reporter: Galder Zamarreño
"Cache Contents / Entries" field in management not correctly calculated. The screenshot should show 101 entries and not 50. See steps to reproduce.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (ISPN-6542) Subclasses of AbstractWriteKeyCommand don't marshal the Params params field
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-6542?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño updated ISPN-6542:
-----------------------------------
Status: Resolved (was: Pull Request Sent)
Fix Version/s: 9.0.0.Alpha3
9.0.0.Final
Resolution: Done
> Subclasses of AbstractWriteKeyCommand don't marshal the Params params field
> ---------------------------------------------------------------------------
>
> Key: ISPN-6542
> URL: https://issues.jboss.org/browse/ISPN-6542
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Affects Versions: 8.2.1.Final
> Reporter: Krzysztof Sobolewski
> Assignee: Radim Vansa
> Fix For: 9.0.0.Alpha3, 9.0.0.Final
>
>
> I'm attempting to use the Functional API, but I'm unable to because of an exception like this:
> java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from FunctionalCachestoreTest-NodeB-820, see cause for remote stack trace
> at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
> at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
> (...)
> Caused by: java.lang.NullPointerException
> at org.infinispan.interceptors.CacheWriterInterceptor.visitWriteCommand(CacheWriterInterceptor.java:233)
> at org.infinispan.interceptors.CacheWriterInterceptor.visitReadWriteKeyCommand(CacheWriterInterceptor.java:215)
> at org.infinispan.commands.functional.ReadWriteKeyCommand.acceptVisitor(ReadWriteKeyCommand.java:90)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.CacheLoaderInterceptor.visitDataCommand(CacheLoaderInterceptor.java:190)
> at org.infinispan.interceptors.CacheLoaderInterceptor.visitReadWriteKeyCommand(CacheLoaderInterceptor.java:331)
> at org.infinispan.commands.functional.ReadWriteKeyCommand.acceptVisitor(ReadWriteKeyCommand.java:90)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:496)
> at org.infinispan.interceptors.EntryWrappingInterceptor.setSkipRemoteGetsAndInvokeNextForDataCommand(EntryWrappingInterceptor.java:561)
> at org.infinispan.interceptors.EntryWrappingInterceptor.visitReadWriteKeyCommand(EntryWrappingInterceptor.java:379)
> at org.infinispan.commands.functional.ReadWriteKeyCommand.acceptVisitor(ReadWriteKeyCommand.java:90)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:97)
> at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:41)
> at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitReadWriteKeyCommand(AbstractLockingInterceptor.java:160)
> at org.infinispan.commands.functional.ReadWriteKeyCommand.acceptVisitor(ReadWriteKeyCommand.java:90)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:343)
> at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:281)
> at org.infinispan.statetransfer.StateTransferInterceptor.visitReadWriteKeyCommand(StateTransferInterceptor.java:204)
> at org.infinispan.commands.functional.ReadWriteKeyCommand.acceptVisitor(ReadWriteKeyCommand.java:90)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:113)
> at org.infinispan.commands.AbstractVisitor.visitReadWriteKeyCommand(AbstractVisitor.java:203)
> at org.infinispan.commands.functional.ReadWriteKeyCommand.acceptVisitor(ReadWriteKeyCommand.java:90)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:110)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:79)
> at org.infinispan.commands.AbstractVisitor.visitReadWriteKeyCommand(AbstractVisitor.java:203)
> at org.infinispan.commands.functional.ReadWriteKeyCommand.acceptVisitor(ReadWriteKeyCommand.java:90)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
> at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:113)
> at org.infinispan.commands.AbstractVisitor.visitReadWriteKeyCommand(AbstractVisitor.java:203)
> at org.infinispan.commands.functional.ReadWriteKeyCommand.acceptVisitor(ReadWriteKeyCommand.java:90)
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:335)
> at org.infinispan.commands.remote.BaseRpcInvokingCommand.processVisitableCommand(BaseRpcInvokingCommand.java:43)
> at org.infinispan.commands.remote.SingleRpcCommand.perform(SingleRpcCommand.java:51)
> at org.infinispan.remoting.inboundhandler.BasePerCacheInboundInvocationHandler.invokePerform(BasePerCacheInboundInvocationHandler.java:92)
> at org.infinispan.remoting.inboundhandler.BaseBlockingRunnable.run(BaseBlockingRunnable.java:34)
> ... 3 more
> The line where the exception occurs is:
> Param<PersistenceMode> persistMode = command.getParams().get(PersistenceMode.ID);
> Turns out that command.getParams() returns null. Investigating further, it looks like the "params" field of ReadWriteKeyCommand is not marshaled; the receiver then unmarshals everythng except the "params" field, which remains null on the remote node, where the command fails.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (ISPN-6630) NotSerializableException while executing streams via JavaScript in a cluster in DIST mode (without additional casting to Serializable)
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-6630?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño updated ISPN-6630:
-----------------------------------
Status: Pull Request Sent (was: Coding In Progress)
Git Pull Request: https://github.com/infinispan/infinispan/pull/4356
> NotSerializableException while executing streams via JavaScript in a cluster in DIST mode (without additional casting to Serializable)
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-6630
> URL: https://issues.jboss.org/browse/ISPN-6630
> Project: Infinispan
> Issue Type: Bug
> Components: Tasks
> Reporter: Anna Manukyan
> Assignee: Galder Zamarreño
> Fix For: 9.0.0.Alpha3, 9.0.0.Final
>
>
> When running map/reduce task using distributed streams through Javascript in DIST/REPL mode, then the following exception is thrown:
> {code}
> 15:02:43,476 ERROR (remote-thread-ClusteredScriptingTest-NodeF-p38-t6) [RpcManagerImpl] ISPN000073: Unexpected error while replicating
> org.infinispan.commons.marshall.NotSerializableException: org.infinispan.scripting.impl.DataTypedCache
> Caused by: an exception which occurred:
> in field capturedArgs
> in object org.infinispan.scripting.impl.DataTypedCache$$Lambda$97/1644130139@5a8a3b80
> -> toString = org.infinispan.scripting.impl.DataTypedCache$$Lambda$97/1644130139@5a8a3b80
> in object java.util.ArrayDeque@2c4c2ba3
> -> toString = [org.infinispan.stream.impl.intops.object.MapOperation@31f4ac20]
> in object org.infinispan.stream.impl.termop.SegmentRetryingOperation@1aad4974
> -> toString = org.infinispan.stream.impl.termop.SegmentRetryingOperation@1aad4974
> in object org.infinispan.stream.impl.StreamRequestCommand@734ebbb6
> java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from ClusteredScriptingTest-NodeF-8182, see cause for remote stack trace
> at org.infinispan.test.TestingUtil.withCacheManagers(TestingUtil.java:1318)
> at org.infinispan.scripting.ClusteredScriptingTest.testDistributedMapReduceStreamWithFlag(ClusteredScriptingTest.java:127)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
> at org.testng.TestRunner.privateRun(TestRunner.java:767)
> at org.testng.TestRunner.run(TestRunner.java:617)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
> at org.testng.SuiteRunner.run(SuiteRunner.java:254)
> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
> at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
> at org.testng.TestNG.run(TestNG.java:1057)
> at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
> at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:122)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
> Caused by: java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from ClusteredScriptingTest-NodeF-8182, see cause for remote stack trace
> at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
> at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
> at org.infinispan.scripting.ClusteredScriptingTest$6.call(ClusteredScriptingTest.java:139)
> at org.infinispan.test.TestingUtil.withCacheManagers(TestingUtil.java:1314)
> ... 29 more
> Caused by: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from ClusteredScriptingTest-NodeF-8182, see cause for remote stack trace
> at org.infinispan.remoting.transport.AbstractTransport.checkResponse(AbstractTransport.java:44)
> at org.infinispan.remoting.transport.jgroups.JGroupsTransport.checkRsp(JGroupsTransport.java:818)
> at org.infinispan.remoting.transport.jgroups.JGroupsTransport.lambda$invokeRemotelyAsync$306(JGroupsTransport.java:648)
> at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
> at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
> at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
> at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
> at org.infinispan.remoting.transport.jgroups.SingleResponseFuture.futureDone(SingleResponseFuture.java:30)
> at org.jgroups.blocks.Request.checkCompletion(Request.java:151)
> at org.jgroups.blocks.UnicastRequest.receiveResponse(UnicastRequest.java:70)
> at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:369)
> at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:233)
> at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:695)
> at org.jgroups.JChannel.up(JChannel.java:738)
> at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1030)
> at org.jgroups.protocols.RSVP.up(RSVP.java:201)
> at org.jgroups.protocols.FRAG2.up(FRAG2.java:165)
> at org.jgroups.protocols.FlowControl.up(FlowControl.java:390)
> at org.jgroups.protocols.tom.TOA.up(TOA.java:121)
> at org.jgroups.protocols.pbcast.GMS.up(GMS.java:1043)
> at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
> at org.jgroups.protocols.UNICAST3.deliverMessage(UNICAST3.java:1070)
> at org.jgroups.protocols.UNICAST3.handleDataReceived(UNICAST3.java:785)
> at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:426)
> at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:649)
> at org.jgroups.protocols.Discovery.up(Discovery.java:296)
> at org.jgroups.protocols.TP.passMessageUp(TP.java:1567)
> at org.jgroups.protocols.TP$SingleMessageHandler.run(TP.java:1783)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.infinispan.commons.marshall.NotSerializableException: org.infinispan.scripting.impl.DataTypedCache
> Caused by: an exception which occurred:
> in field capturedArgs
> in object org.infinispan.scripting.impl.DataTypedCache$$Lambda$97/1644130139@5a8a3b80
> -> toString = org.infinispan.scripting.impl.DataTypedCache$$Lambda$97/1644130139@5a8a3b80
> in object java.util.ArrayDeque@2c4c2ba3
> -> toString = [org.infinispan.stream.impl.intops.object.MapOperation@31f4ac20]
> in object org.infinispan.stream.impl.termop.SegmentRetryingOperation@1aad4974
> -> toString = org.infinispan.stream.impl.termop.SegmentRetryingOperation@1aad4974
> in object org.infinispan.stream.impl.StreamRequestCommand@734ebbb6
> -> toString = StreamRequestCommand{cacheName='___defaultcache'}
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (ISPN-6300) Parameters, CacheManager and Marshaller are not passed to JavaScript in case of mode=distributed
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-6300?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño updated ISPN-6300:
-----------------------------------
Git Pull Request: https://github.com/infinispan/infinispan/pull/4272, https://github.com/infinispan/infinispan/pull/4356 (was: https://github.com/infinispan/infinispan/pull/4272)
> Parameters, CacheManager and Marshaller are not passed to JavaScript in case of mode=distributed
> ------------------------------------------------------------------------------------------------
>
> Key: ISPN-6300
> URL: https://issues.jboss.org/browse/ISPN-6300
> Project: Infinispan
> Issue Type: Bug
> Components: Tasks
> Affects Versions: 8.1.2.Final
> Reporter: Anna Manukyan
> Assignee: Galder Zamarreño
> Fix For: 9.0.0.Alpha2, 9.0.0.Final
>
>
> When in javascript file the mode is set to distributed, the cacheManager, marshaller and parameters are not passed from the server.
> {code}
> // mode=distributed,language=javascript,parameters=[a]
> cache.put("a", a)
> cacheManager.getAddress()
> {code}
> Java Call:
> {code}
> CompletableFuture<ArrayList<JGroupsAddress>> resultsFuture = scriptingManager.runScript("distExec.js", new TaskContext().cache(cache(0)).addParameter("a", "value"));
> {code}
> The following line execution throws:
> {code}
> Caused by: <eval>:3 ReferenceError: "a" is not defined
> or
> "cacheManager" is not defined if the cache put is commented.
> {code}
> UPDATE:
> When the same script is run using on Hotrod Server via Hotrod client, the following exception is thrown:
> {code}
> org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=53 returned server error (status=0x85): java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from ExecTest-NodeA-26018, see cause for remote stack trace
> java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from ExecTest-NodeA-26018, see cause for remote stack trace
> org.infinispan.remoting.RemoteException: ISPN000217: Received exception from ExecTest-NodeA-26018, see cause for remote stack trace
> org.infinispan.commons.marshall.NotSerializableException: jdk.nashorn.api.scripting.ScriptObjectMirror
> an exception which occurred:
> in field ecmaError
> in field cause
> in field cause
> in object org.infinispan.commons.CacheException@5f8d3629
> -> toString = org.infinispan.commons.CacheException: ISPN026003: Script execution error
> in object org.infinispan.remoting.responses.ExceptionResponse@19da5d4b
> -> toString = ExceptionResponse
> at org.infinispan.client.hotrod.impl.protocol.Codec20.checkForErrorsInResponseStatus(Codec20.java:343)
> at org.infinispan.client.hotrod.impl.protocol.Codec20.readPartialHeader(Codec20.java:132)
> at org.infinispan.client.hotrod.impl.protocol.Codec20.readHeader(Codec20.java:118)
> at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:56)
> at org.infinispan.client.hotrod.impl.operations.ExecuteOperation.executeOperation(ExecuteOperation.java:49)
> at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:54)
> at org.infinispan.client.hotrod.impl.RemoteCacheImpl.execute(RemoteCacheImpl.java:703)
> at org.infinispan.client.hotrod.ExecTest.testScriptExecutionWithPassingParams(ExecTest.java:119)
> ...
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (ISPN-6173) NotSerializableException while executing streams via JavaScript in a cluster in DIST mode
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-6173?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño commented on ISPN-6173:
----------------------------------------
[~amanukyan], good points, but let's look at the closer at those example scripts in {{wordCountStream_Exec.js}} and {{wordCountStream_serializable.js}}:
https://github.com/infinispan/infinispan/blob/master/scripting/src/test/j... refers to {{wordCountStream_serializable.js}} which is defined as:
{code}
// mode=local,language=javascript
var Function = Java.type("java.util.function.Function")
var Serializable = Java.type("java.io.Serializable")
var Collectors = Java.type("java.util.stream.Collectors")
var Arrays = Java.type("org.infinispan.scripting.utils.JSArrays")
var CacheCollectors = Java.type("org.infinispan.stream.CacheCollectors");
var SerializableFunction = Java.extend(Function, Serializable);
var SerializableSupplier = Java.extend(Java.type("org.infinispan.util.function.SerializableSupplier"))
var e = new SerializableFunction( {
apply: function(object) {
return object.getValue().toLowerCase().split(/[\W]+/)
}
})
var f = new SerializableFunction({
apply: function(f) {
return Arrays.stream(f)
}
})
var s = new SerializableSupplier({
get: function() {
return Collectors.groupingBy(Function.identity(), Collectors.counting())
}
})
cache.entrySet().stream().map(e)
.flatMap(f)
.collect(CacheCollectors.serializableCollector(s));
{code}
The same can be achieved with this simpler code as indicated in `wordStream.js` which works fine with {{mode=local}} since {{testDistributedMapReduceStreamWithFlag}} passes:
{code}
// mode=local,language=javascript
var Function = Java.type("java.util.function.Function")
var Collectors = Java.type("java.util.stream.Collectors")
var Arrays = Java.type("org.infinispan.scripting.utils.JSArrays")
cache
.entrySet().stream()
.map(function(e) e.getValue())
.map(function(v) v.toLowerCase())
.map(function(v) v.split(/[\W]+/))
.flatMap(function(f) Arrays.stream(f))
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
{code}
The reason this is working as is without the need to do any wrapping with Serializable is because of the work Will did in ISPN-6272. You can now pass in a lambda and underneath it will be made Serializable. I can't pinpoint the exact reason why your Serializable wrapped versions do not work, but if the straightforward way defined in {{wordStream.js}} works, that should do for now.
> NotSerializableException while executing streams via JavaScript in a cluster in DIST mode
> -----------------------------------------------------------------------------------------
>
> Key: ISPN-6173
> URL: https://issues.jboss.org/browse/ISPN-6173
> Project: Infinispan
> Issue Type: Bug
> Reporter: Anna Manukyan
> Assignee: Galder Zamarreño
> Fix For: 9.0.0.Alpha3, 9.0.0.Final
>
> Attachments: wordCountStream_Exec.js
>
>
> The following exception appears when I try to execute a JS script which uses Java Stream API on 4 node cluster in DIST_SYNC mode. No matter which mode is set in JS metadata (local or distributed) the test ends with exception.
> You can find the test and the script here:
> https://github.com/andyuk1986/infinispan/blob/2e19b65a00d962201c81216ca3b...
> https://github.com/andyuk1986/infinispan/blob/2e19b65a00d962201c81216ca3b...
> When the mode=local, the exception is:
> {code}
> org.infinispan.commons.marshall.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_LL
> Caused by: an exception which occurred:
> in field apply
> in object jdk.nashorn.javaadapters.java.util.function.Function$$Serializable@5e828108
> -> toString = jdk.nashorn.javaadapters.java.util.function.Function$$Serializable@5e828108
> in object java.util.ArrayDeque@7074aba7
> -> toString = [org.infinispan.stream.impl.intops.object.MapOperation@11cc7142]
> in object org.infinispan.stream.impl.termop.SegmentRetryingOperation@70414f65
> -> toString = org.infinispan.stream.impl.termop.SegmentRetryingOperation@70414f65
> in object org.infinispan.stream.impl.StreamRequestCommand@38614d0c
> -> toString = StreamRequestCommand{cacheName='___defaultcache'}
> {code}
> When the mode=distributed, the exception is:
> {code}
> java.util.concurrent.ExecutionException: java.util.concurrent.CancellationException
> at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
> at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
> at org.infinispan.scripting.DistributedCacheScriptingTest.testDistributedMapReduceStream(DistributedCacheScriptingTest.java:61)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
> at org.testng.TestRunner.privateRun(TestRunner.java:767)
> at org.testng.TestRunner.run(TestRunner.java:617)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
> at org.testng.SuiteRunner.access$000(SuiteRunner.java:38)
> at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:382)
> at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.util.concurrent.CancellationException
> at java.util.concurrent.CompletableFuture.cancel(CompletableFuture.java:2263)
> at org.infinispan.util.concurrent.CompletableFutures.lambda$toCompletableFuture$16(CompletableFutures.java:49)
> at org.infinispan.commons.util.concurrent.BaseNotifyingFuture.fireListeners(BaseNotifyingFuture.java:37)
> at org.infinispan.commons.util.concurrent.NotifyingFutureImpl.notifyException(NotifyingFutureImpl.java:105)
> at org.infinispan.distexec.DefaultExecutorService$LocalDistributedTaskPart$1.doLocalInvoke(DefaultExecutorService.java:1117)
> at org.infinispan.distexec.DefaultExecutorService$LocalDistributedTaskPart$1.call(DefaultExecutorService.java:1103)
> ... 4 more
> {code}
> But for both cases, from the TRACE logs the real exception is:
> {code}
> java.io.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_LL
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.infinispan.stream.impl.intops.IntermediateOperationExternalizer.writeObject(IntermediateOperationExternalizer.java:194) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.intops.IntermediateOperationExternalizer.writeObject(IntermediateOperationExternalizer.java:23) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.core.ExternalizerTable$ExternalizerAdapter.writeObject(ExternalizerTable.java:481) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:138) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:569) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.infinispan.stream.impl.termop.TerminalOperationExternalizer.writeObject(TerminalOperationExternalizer.java:83) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.termop.TerminalOperationExternalizer.writeObject(TerminalOperationExternalizer.java:34) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.core.ExternalizerTable$ExternalizerAdapter.writeObject(ExternalizerTable.java:481) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:138) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeCommandParameters(ReplicableCommandExternalizer.java:66) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.marshallParameters(CacheRpcCommandExternalizer.java:128) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.writeObject(CacheRpcCommandExternalizer.java:112) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.writeObject(CacheRpcCommandExternalizer.java:68) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.core.ExternalizerTable$ExternalizerAdapter.writeObject(ExternalizerTable.java:481) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:138) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) ~[jboss-marshalling-osgi-1.4.10.Final.jar:1.4.10.Final]
> at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.objectToObjectStream(AbstractJBossMarshaller.java:72) ~[infinispan-commons-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.marshall.core.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:77) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.commons.marshall.AbstractMarshaller.objectToBuffer(AbstractMarshaller.java:41) [infinispan-commons-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.commons.marshall.AbstractDelegatingMarshaller.objectToBuffer(AbstractDelegatingMarshaller.java:85) [infinispan-commons-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.MarshallerAdapter.objectToBuffer(MarshallerAdapter.java:23) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.marshallCall(CommandAwareRpcDispatcher.java:247) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.processSingleCall(CommandAwareRpcDispatcher.java:265) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommand(CommandAwareRpcDispatcher.java:121) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotelyAsync(JGroupsTransport.java:578) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotelyAsync(RpcManagerImpl.java:162) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.ClusterStreamManagerImpl.submitAsyncTasks(ClusterStreamManagerImpl.java:169) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.ClusterStreamManagerImpl.commonRemoteStreamOperation(ClusterStreamManagerImpl.java:86) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.ClusterStreamManagerImpl.remoteStreamOperationRehashAware(ClusterStreamManagerImpl.java:70) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.AbstractCacheStream.performOperationRehashAware(AbstractCacheStream.java:306) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.AbstractCacheStream.performOperation(AbstractCacheStream.java:258) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.stream.impl.DistributedCacheStream.collect(DistributedCacheStream.java:329) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at jdk.nashorn.internal.scripts.Script$\^eval\_.:program(<eval>:23) [?:?]
> at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:640) [nashorn.jar:?]
> at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228) [nashorn.jar:?]
> at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) [nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:418) [nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.access$300(NashornScriptEngine.java:73) [nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:511) [nashorn.jar:?]
> at javax.script.CompiledScript.eval(CompiledScript.java:92) [?:1.8.0_66]
> at org.infinispan.scripting.impl.ScriptingManagerImpl.execute(ScriptingManagerImpl.java:182) [classes/:?]
> at org.infinispan.scripting.impl.DistributedScript.call(DistributedScript.java:30) [classes/:?]
> at org.infinispan.commands.read.DistributedExecuteCommand.perform(DistributedExecuteCommand.java:103) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.distexec.DefaultExecutorService$LocalDistributedTaskPart$1.doLocalInvoke(DefaultExecutorService.java:1113) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.distexec.DefaultExecutorService$LocalDistributedTaskPart$1.call(DefaultExecutorService.java:1103) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_66]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_66]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_66]
> at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
> Caused by: org.jboss.marshalling.TraceInformation
> {code}
> Seems that this is general Nashorn thing, as complex object serialization also gives the same exception. E.g the following script execution throws same exception with a bit different stack trace:
> {code}
> // mode=distributed,language=javascript
> var Function = Java.type("java.util.function.Function")
> var Serializable = Java.type("java.io.Serializable")
> var SerializableFunction = Java.extend(Function, Serializable);
> var CollectionsAndFiles = new JavaImporter(
> java.util,
> java.io,
> java.nio);
> var e = new SerializableFunction( {
> apply: function(object) {
> return object.getValue().toLowerCase().split(/[\\W]+/)
> }
> })
> with (CollectionsAndFiles) {
> var bos = new ByteArrayOutputStream();
> var out = null;
> try {
> out = new ObjectOutputStream(bos);
> out.writeObject(e);
> var yourBytes = bos.toByteArray();
> } finally {
> try {
> if (out != null) {
> out.close();
> }
> } finally {
> }
> }
> }
> {code}
> the stacktrace for the code above is:
> {code}
> java.lang.RuntimeException: java.io.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_LL
> at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:397) ~[nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:446) ~[nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:403) ~[nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:399) ~[nashorn.jar:?]
> at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155) ~[nashorn.jar:?]
> at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233) ~[?:1.8.0_66]
> at org.infinispan.scripting.impl.ScriptingManagerImpl.execute(ScriptingManagerImpl.java:186) ~[classes/:?]
> at org.infinispan.scripting.impl.DistributedScript.call(DistributedScript.java:30) ~[classes/:?]
> at org.infinispan.commands.read.DistributedExecuteCommand.perform(DistributedExecuteCommand.java:103) ~[infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.inboundhandler.BasePerCacheInboundInvocationHandler.invokePerform(BasePerCacheInboundInvocationHandler.java:92) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at org.infinispan.remoting.inboundhandler.BaseBlockingRunnable.run(BaseBlockingRunnable.java:34) [infinispan-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_66]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_66]
> at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
> Caused by: java.io.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_LL
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[?:1.8.0_66]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) ~[?:1.8.0_66]
> at jdk.nashorn.internal.scripts.Script$2$\^eval\_.:program(<eval>:21) ~[?:?]
> at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:640) ~[nashorn.jar:?]
> at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228) ~[nashorn.jar:?]
> at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[nashorn.jar:?]
> ... 13 more
> {code}
> UPDATE:
> In case when the test tries to execute javascript where the mode is set to local, and the map/reduce is executed using submitConsumer(...) method of the cacheManager's executor, the following exception is thrown:
> {code}
> java.util.concurrent.CompletionException: java.lang.ClassCastException: Cannot cast org.infinispan.manager.DefaultCacheManager to java.util.function.Function
> org.infinispan.commons.marshall.NotSerializableException: java.lang.invoke.BoundMethodHandle$Species_L3
> Caused by: an exception which occurred:
> in field apply
> in object jdk.nashorn.javaadapters.java.util.function.Function$$Serializable@1ad8df52
> -> toString = jdk.nashorn.javaadapters.java.util.function.Function$$Serializable@1ad8df52
> in object org.infinispan.manager.impl.ReplicableCommandManagerFunction@a52ca2e
> -> toString = org.infinispan.manager.impl.ReplicableCommandManagerFunction@a52ca2e
> {code}
> The code is attached wordCountStream_Exec.js.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months