alan.zhao created FLINK-37782:
---------------------------------

             Summary: flink-rpc-core RemoteHandshakeMessage nullness annotation
                 Key: FLINK-37782
                 URL: https://issues.apache.org/jira/browse/FLINK-37782
             Project: Flink
          Issue Type: Bug
          Components: Runtime / RPC
    Affects Versions: 2.0.0
            Reporter: alan.zhao


when i run test MiniClusterITCase#runJobWithSingleRpcService, i got errors
```
-ideVersion5 -junit5 
org.apache.flink.runtime.minicluster.MiniClusterITCase,runJobWithMultipleRpcServices

org.apache.flink.runtime.client.JobExecutionException: Could not retrieve 
JobResult.

        at 
org.apache.flink.runtime.minicluster.MiniCluster.executeJobBlocking(MiniCluster.java:1058)
        at 
org.apache.flink.runtime.minicluster.MiniClusterITCase.runJobWithMultipleRpcServices(MiniClusterITCase.java:100)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at 
java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
        at 
java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at 
java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at 
java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at 
java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: org.apache.flink.util.concurrent.FutureUtils$RetryException: Could 
not complete the operation. Number of retries has been exhausted.
        at 
org.apache.flink.util.concurrent.FutureUtils.lambda$4(FutureUtils.java:295)
        at 
java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
        at 
java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
        at 
java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
        at 
java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
        at 
org.apache.flink.util.concurrent.FutureUtils.doForward(FutureUtils.java:1315)
        at 
org.apache.flink.runtime.concurrent.ClassLoadingUtils.lambda$3(ClassLoadingUtils.java:93)
        at 
org.apache.flink.runtime.concurrent.ClassLoadingUtils.runWithContextClassLoader(ClassLoadingUtils.java:68)
        at 
org.apache.flink.runtime.concurrent.ClassLoadingUtils.lambda$2(ClassLoadingUtils.java:92)
        at 
java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
        at 
java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
        at 
java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
        at 
java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
        at 
scala.concurrent.java8.FuturesConvertersImpl$CF$$anon$1.accept(FutureConvertersImpl.scala:63)
        at 
scala.concurrent.java8.FuturesConvertersImpl$CF$$anon$1.accept(FutureConvertersImpl.scala:61)
        at 
java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
        at 
java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
        at 
java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
        ... 6 more
Caused by: java.util.concurrent.CompletionException: java.lang.Error: 
Unresolved compilation problems: 
        The nullness annotation @Nonnull is not applicable for the primitive 
type int
        The nullness annotation @Nonnull is not applicable for the primitive 
type int
        The nullness annotation @Nonnull is not applicable for the primitive 
type int

        at 
java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
        at 
java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
        at 
java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159)
        ... 13 more
Caused by: java.lang.Error: Unresolved compilation problems: 
        The nullness annotation @Nonnull is not applicable for the primitive 
type int
        The nullness annotation @Nonnull is not applicable for the primitive 
type int
        The nullness annotation @Nonnull is not applicable for the primitive 
type int

        at 
org.apache.flink.runtime.rpc.messages.RemoteHandshakeMessage.<init>(RemoteHandshakeMessage.java:35)
        at 
org.apache.flink.runtime.rpc.pekko.PekkoRpcService.lambda$connectInternal$8(PekkoRpcService.java:509)
        at 
java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
        ... 13 more


Process finished with exit code 255
```

Based on the error message, I removed the @NonNull annotation from the 
`version` field in `RemoteHandshakeMessage`, and the test ran successfully. 
However, now I cannot reproduce the error: even if 
`RemoteHandshakeMessage#version` has the @Nonnull annotation, the test still 
passes. I don't know the reason, but I suspect @Nonnull is not applicable to 
primitive types like `int`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to