Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.11.0
-
None
-
None
Description
After any model (business) exception, java async client comes to an illegal state. This prevents it from being used again in the client pool. However, the synchronous client in the same case remains operational.
This feature of the asynchronous client makes it less efficient compared to synchronous when using client pools.
Attached test demonstrates this issue.
Tests run: 8, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 1.963 sec <<< FAILURE! async_client_must_be_reusable_after_model_exceptions[serverImplementationType = SYNC_SERVER](org.apache.thrift.test.ClientReusabilityTest) Time elapsed: 0.032 sec <<< ERROR! java.lang.IllegalStateException: Client has an error! at org.apache.thrift.async.TAsyncClient.checkReady(TAsyncClient.java:83) at org.apache.thrift.test.model.TAppService01$AsyncClient.doSomething(TAppService01.java:91) at org.apache.thrift.test.ClientReusabilityTest.checkAsyncClientReusability(ClientReusabilityTest.java:152) at org.apache.thrift.test.ClientReusabilityTest.async_client_must_be_reusable_after_model_exceptions(ClientReusabilityTest.java:105) 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:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) 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:498) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) Caused by: TExampleException(message:example model exception) at org.apache.thrift.test.model.TAppService01$doSomething_result$doSomething_resultStandardScheme.read(TAppService01.java:1099) at org.apache.thrift.test.model.TAppService01$doSomething_result$doSomething_resultStandardScheme.read(TAppService01.java:1077) at org.apache.thrift.test.model.TAppService01$doSomething_result.read(TAppService01.java:1019) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:88) at org.apache.thrift.test.model.TAppService01$Client.recv_doSomething(TAppService01.java:62) at org.apache.thrift.test.model.TAppService01$AsyncClient$doSomething_call.getResult(TAppService01.java:121) at org.apache.thrift.test.model.TAppService01$AsyncClient$doSomething_call.getResult(TAppService01.java:97) at org.apache.thrift.async.TAsyncMethodCall.cleanUpAndFireCallback(TAsyncMethodCall.java:235) at org.apache.thrift.async.TAsyncMethodCall.doReadingResponseBody(TAsyncMethodCall.java:225) at org.apache.thrift.async.TAsyncMethodCall.transition(TAsyncMethodCall.java:201) at org.apache.thrift.async.TAsyncClientManager$SelectThread.transitionMethods(TAsyncClientManager.java:143) at org.apache.thrift.async.TAsyncClientManager$SelectThread.run(TAsyncClientManager.java:113)