]
Galder Zamarreño updated ISPN-4551:
-----------------------------------
Status: Resolved (was: Pull Request Sent)
Fix Version/s: 7.0.0.Beta1
Resolution: Done
RestStore parallel iteration fails for non-string keys if UTF-8 is
not the default charset
------------------------------------------------------------------------------------------
Key: ISPN-4551
URL:
https://issues.jboss.org/browse/ISPN-4551
Project: Infinispan
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Remote Protocols, Server
Affects Versions: 7.0.0.Alpha5
Reporter: Ion Savin
Assignee: Ion Savin
Fix For: 7.0.0.Beta1
On systems where UTF-8 is not the default charset parallel iteration over non-string keys
fails.
Non-string keys are mapped to strings prefixed by \uFEFF when the entry is stored. The
key is URL-encoded and the prefix is stored properly. The GET /cacheName (all keys)
response however uses the system-default charset and if that's not UTF-8 the prefix
cannot be mapped and ends up being "?".
To reproduce set the charset to ISO-8859-1 and run RestStoreParallelIterationTest and you
should see failures similar to this one:
{noformat}
[testng-RestStoreParallelIterationTest] Test
testSequentialIteration(org.infinispan.persistence.rest.RestStoreParallelIterationTest)
failed.
10:11:27,629 ERROR [org.infinispan.test.fwk.UnitTestTestNGListener]
(testng-RestStoreParallelIterationTest) Test
testSequentialIteration(org.infinispan.persistence.rest.RestStoreParallelIterationTest)
failed.
org.infinispan.persistence.spi.PersistenceException: ISPN022005: Error loading entries
from remote server
at org.infinispan.persistence.rest.RestStore.process(RestStore.java:295)
at
org.infinispan.persistence.ParallelIterationTest.runIterationTest(ParallelIterationTest.java:103)
at
org.infinispan.persistence.ParallelIterationTest.testSequentialIteration(ParallelIterationTest.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.infinispan.persistence.spi.PersistenceException: Execution exception!
at org.infinispan.persistence.rest.RestStore.process(RestStore.java:292)
... 22 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at
org.infinispan.executors.ExecutorAllCompletionService.pollUntilEmpty(ExecutorAllCompletionService.java:48)
at
org.infinispan.executors.ExecutorAllCompletionService.submit(ExecutorAllCompletionService.java:32)
at
org.infinispan.persistence.rest.RestStore.submitProcessTask(RestStore.java:304)
at org.infinispan.persistence.rest.RestStore.process(RestStore.java:284)
... 22 more
Caused by: java.lang.NullPointerException
at
org.infinispan.persistence.ParallelIterationTest$2.processEntry(ParallelIterationTest.java:106)
at org.infinispan.persistence.rest.RestStore$1.call(RestStore.java:314)
at org.infinispan.persistence.rest.RestStore$1.call(RestStore.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22)
at
java.util.concurrent.ExecutorCompletionService.submit(ExecutorCompletionService.java:181)
at
org.infinispan.executors.ExecutorAllCompletionService.submit(ExecutorAllCompletionService.java:31)
... 24 more
{noformat}