[TIKA-4704] Implement pipes client shutdown in TikaGrpcServerImpl#2746
[TIKA-4704] Implement pipes client shutdown in TikaGrpcServerImpl#2746
Conversation
Added shutdown logic for pipes client in TikaGrpcServerImpl.
There was a problem hiding this comment.
Pull request overview
This PR adds explicit shutdown/cleanup logic for the PipesClient used by the gRPC service implementation, so that underlying pipes resources are closed when the gRPC server is stopped.
Changes:
- Close
pipesClientduringTikaGrpcServerImpl.shutdown(). - Add logging around pipes client shutdown.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
Outdated
Show resolved
Hide resolved
tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
Outdated
Show resolved
Hide resolved
tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
Show resolved
Hide resolved
…verImpl.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ensure igniteStoreServer is set to null in finally block.
Invoke postShutdown on service implementation if not null.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (server != null) { | ||
| server | ||
| .shutdown() | ||
| .awaitTermination(30, TimeUnit.SECONDS); | ||
| } |
There was a problem hiding this comment.
Server.awaitTermination(30, TimeUnit.SECONDS) returns after the timeout even if the server is still running; because the return value is ignored, postShutdown() (which closes pipesClient) may run while RPCs are still in-flight. Consider checking the boolean result and only closing pipesClient once termination has actually occurred (or call shutdownNow()/wait longer when the graceful shutdown times out).
Added shutdown logic for pipes client in TikaGrpcServerImpl.
Thanks for your contribution to Apache Tika! Your help is appreciated!
Before opening the pull request, please verify that
TIKA-XXXX)[TIKA-XXXX] Issue or pull request title)./mvnw clean testmainbranch. If there are conflicts, please try to rebase the pull request branch on top of a freshly pulledmainbranchtika-bom/pom.xml.We will be able to faster integrate your pull request if these conditions are met. If you have any questions how to fix your problem or about using Tika in general, please sign up for the Tika mailing list. Thanks!