question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gRPC does not discover `@Blocking` correctly

See original GitHub issue

Describe the bug

io.quarkus.grpc.deployment.GrpcServerProcessor#gatherBlockingMethods only discovers @Blocking on classes that directly extend the gRPC *ImplBase classes, but not on subclasses.

@Blocking discovery works in these cases:

@Blocking
@GrpcService
class MyService extends MyServiceImplBase {
  // ...
}

and

// in another artifact
@GrpcService
class MyServiceSuper extends MyServiceImplBase {
  // ...
}

class MyService extends MyServiceSuper {
  // @Blocking must be applied to all methods - aka must override all methods here
  @Blocking
  @Override
  void methodFromMyServiceImplBase() {
    // ...
  }
}

@Blocking discovery does not work in this case:

// in another artifact
class MyServiceSuper extends MyServiceImplBase {
  // ...
}

@Blocking // doesn't work, not detected by GrpcServerProcessor#gatherBlockingMethods
@GrpcService
class MyService extends MyServiceSuper {
  // ...
}

Expected behavior

Allow @Blocking on classes that indirectly extend *ImplBase

Actual behavior

@Blocking is not detected for class MyService extends BaseService extends MyServiceImplBase (not proper Java…)

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.2

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
snazycommented, Feb 25, 2022

Hello @snazy, I miss the @GrpcService annotation in the examples. Is MyService supposed to be the service impl that should be registered?

Oops, yea. Updated the description.

1reaction
snazycommented, Feb 23, 2022

I’ll try to prepare a PR to fix this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble-Shooting | grpc-spring-boot-starter - GitHub Pages
The server/client does not start because some class or method is missing. This is usually the case if the grpc-libraries use slightly different...
Read more >
How can I manage blocking code inside gRPC-java server ...
The easiest way is to do this is pass the responseObserver to the long running task: @Override public void getData(RequestValue requestValue ...
Read more >
So You Want to Optimize gRPC - Part 1
Unlike the client code, the service handler is non-blocking, meaning it doesn't return a value like a function call would.
Read more >
Akka gRPC
Akka gRPC - Support for building streaming gRPC servers and clients on top of Akka Streams.
Read more >
Troubleshoot proxyless gRPC deployments | Traffic Director
For information about how to use the Client Status Discovery Service (CSDS) API to ... Do not use an HTTP, HTTPS, or HTTP/2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found