Skip to content

[TIKA-4704] Implement pipes client shutdown in TikaGrpcServerImpl#2746

Merged
THausherr merged 4 commits intomainfrom
TIKA-4704-12
Apr 7, 2026
Merged

[TIKA-4704] Implement pipes client shutdown in TikaGrpcServerImpl#2746
THausherr merged 4 commits intomainfrom
TIKA-4704-12

Conversation

@THausherr
Copy link
Copy Markdown
Contributor

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

  • there is an open issue on the Tika issue tracker which describes the problem or the improvement. We cannot accept pull requests without an issue because the change wouldn't be listed in the release notes.
  • the issue ID (TIKA-XXXX)
    • is referenced in the title of the pull request
    • and placed in front of your commit messages surrounded by square brackets ([TIKA-XXXX] Issue or pull request title)
  • commits are squashed into a single one (or few commits for larger changes)
  • Tika is successfully built and unit tests pass by running ./mvnw clean test
  • there should be no conflicts when merging the pull request branch into the recent main branch. If there are conflicts, please try to rebase the pull request branch on top of a freshly pulled main branch
  • if you add new module that downstream users will depend upon add it to relevant group in tika-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!

Added shutdown logic for pipes client in TikaGrpcServerImpl.
Copilot AI review requested due to automatic review settings April 6, 2026 19:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 pipesClient during TikaGrpcServerImpl.shutdown().
  • Add logging around pipes client shutdown.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…verImpl.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 126 to 130
if (server != null) {
server
.shutdown()
.awaitTermination(30, TimeUnit.SECONDS);
}
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@THausherr THausherr merged commit 27ba181 into main Apr 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants