lib icon indicating copy to clipboard operation
lib copied to clipboard

No matching field found: close for class java.util.concurrent.CompletableFuture (client side).

Open jsulmont opened this issue 4 years ago • 0 comments

Greetings everyone.

Thanks a lot for this cool project, very useful indeed. I have encountered the following client side issue:

summary

  • The problem happens, when a gRPC client calls invoke on an HTTP2Provider that's been reclaimed by Jetty due to idle timeout expiry (30 seconds unless otherwise requested).
  • invoke tries to call .close (here) on the stream (CompletableFuture) which is not a Closable.

how to reproduce

Following the instructions provided in the Quick Start,

  1. first setup the gRPC service, then
  2. setup the gRPC client, then
  3. wait at least 30 seconds (which is the default idle timeout on jetty's HTTP2Client), then
  4. try and execute a request using that client:
user=>  @(greeter/Hello client {:name "Janet Johnathan Doe"})
Feb 26, 2021 8:31:45 AM clojure.tools.logging$eval12569$fn__12572 invoke
SEVERE: GRPC failed: #error {
 :cause No matching field found: close for class java.util.concurrent.CompletableFuture
 :via
 [{:type java.lang.IllegalArgumentException
   :message No matching field found: close for class java.util.concurrent.CompletableFuture
   :at [clojure.lang.Reflector getInstanceField Reflector.java 397]}]

Please note, that the following Reflection warnings when requesting protojure.grpc.client.providers.http2:

user=> (require '[protojure.grpc.client.providers.http2 :as grpc.http2])
Reflection warning, protojure/grpc/codec/lpm.clj:171:5 - reference to field close can't be resolved.
Reflection warning, protojure/internal/grpc/client/providers/http2/core.clj:145:44 - reference to field close can't be resolved.
....

and also:

Reflection warning, protojure/pedestal/core.clj:233:3 - reference to field getPeerAddress can't be resolved.

when requesting protojure.pedestal.core.

On my spare time, I am happy to investigate further and submit a PR, let me know,

Thanks again,

jsulmont avatar Feb 26 '21 09:02 jsulmont