Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fault Tolerance reports an internal error when an asynchronous method returns null #10189

Closed
Joseph-Cass opened this issue Dec 17, 2019 · 1 comment · Fixed by #10392
Closed
Assignees
Labels
bug This bug is not present in a released version of Open Liberty in:MicroProfile/FaultTolerance In Progress Items that are in active development. release bug This bug is present in a released version of Open Liberty release:20002

Comments

@Joseph-Cass
Copy link
Contributor

Describe the bug
Seen whilst writing a unit test. Looks as though if a user has an async method which returns null, FT returns the following internal error:

java.util.concurrent.ExecutionException: org.eclipse.microprofile.faulttolerance.exceptions.FaultToleranceException: internal.error.CWMFT4998E
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
	at com.ibm.ws.microprofile.faulttolerance.test.AsyncTest.testAsyncRequestContextCalls(AsyncTest.java:177)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: org.eclipse.microprofile.faulttolerance.exceptions.FaultToleranceException: internal.error.CWMFT4998E
	at com.ibm.ws.microprofile.faulttolerance20.impl.AsyncExecutor.handleException(AsyncExecutor.java:504)
	at com.ibm.ws.microprofile.faulttolerance20.impl.AsyncExecutor.runExecutionAttempt(AsyncExecutor.java:294)
	at com.ibm.ws.microprofile.faulttolerance20.impl.AsyncExecutor.lambda$0(AsyncExecutor.java:210)
	at com.ibm.ws.microprofile.faulttolerance20.impl.AsyncExecutor$$Lambda$20.0000000000000000.run(Unknown Source)
	at com.ibm.ws.microprofile.faulttolerance20.state.impl.AsyncBulkheadStateNullImpl.lambda$0(AsyncBulkheadStateNullImpl.java:35)
	at com.ibm.ws.microprofile.faulttolerance20.state.impl.AsyncBulkheadStateNullImpl$$Lambda$22.0000000000000000.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	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:831)
Caused by: java.lang.NullPointerException
	at com.ibm.ws.microprofile.faulttolerance20.impl.AsyncCompletionStageExecutor.processMethodResult(AsyncCompletionStageExecutor.java:120)
	at com.ibm.ws.microprofile.faulttolerance20.impl.AsyncExecutor.runExecutionAttempt(AsyncExecutor.java:277)
	... 10 more


Expected behavior
A debug message stating the method should not return null

@Joseph-Cass Joseph-Cass added the bug This bug is not present in a released version of Open Liberty label Dec 17, 2019
@Joseph-Cass Joseph-Cass added this to Other in MicroProfile UK (Old) via automation Dec 17, 2019
@Joseph-Cass Joseph-Cass moved this from Other to Fault Tolerance in MicroProfile UK (Old) Dec 17, 2019
@Joseph-Cass
Copy link
Contributor Author

Needs testing for FT 1.0 and 2.0 and for CompletionStages and Futures

@tevans78 tevans78 added the In Progress Items that are in active development. label Jan 10, 2020
@Joseph-Cass Joseph-Cass self-assigned this Jan 13, 2020
@tevans78 tevans78 added the release bug This bug is present in a released version of Open Liberty label Jan 14, 2020
MicroProfile UK (Old) automation moved this from Fault Tolerance to Done Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This bug is not present in a released version of Open Liberty in:MicroProfile/FaultTolerance In Progress Items that are in active development. release bug This bug is present in a released version of Open Liberty release:20002
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants