[
https://issues.apache.org/jira/browse/TIKA-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18047809#comment-18047809
]
ASF GitHub Bot commented on TIKA-4594:
--------------------------------------
nddipiazza opened a new pull request, #2487:
URL: https://github.com/apache/tika/pull/2487
## Summary
Fixes runtime fetcher/emitter configuration sharing between
TikaGrpcServerImpl and forked PipesServer workers.
## Problem
When using tika-grpc, fetchers and emitters saved via the gRPC
`saveFetcher`/`saveEmitter` endpoints were not available to the forked
PipesServer workers because they used separate ConfigStore instances. This
caused `FetcherNotFoundException` errors when calling `fetchAndParse` after
`saveFetcher`.
## Solution
Modified `PipesServer.initializeResources()` to:
1. Create a ConfigStore from PipesConfig using the same factory mechanism as
TikaGrpcServerImpl
2. Pass this ConfigStore to FetcherManager and EmitterManager so runtime
configurations are shared
3. Enable runtime modification support by passing `true` to the load methods
## Changes
- Added ConfigStore and ConfigStoreFactory imports
- Added `createConfigStore()` helper method to instantiate ConfigStore from
PipesConfig
- Updated `initializeResources()` to create and use ConfigStore for
FetcherManager and EmitterManager
## Testing
This enables the tika-grpc-e2e-test suite to properly test fetcher/emitter
lifecycle through gRPC.
JIRA: https://issues.apache.org/jira/browse/TIKA-4594
> PipesServer does not share ConfigStore with gRPC server causing runtime
> fetcher/emitter configs to be unavailable
> -----------------------------------------------------------------------------------------------------------------
>
> Key: TIKA-4594
> URL: https://issues.apache.org/jira/browse/TIKA-4594
> Project: Tika
> Issue Type: Bug
> Reporter: Nicholas DiPiazza
> Priority: Major
>
> When using tika-grpc, fetchers and emitters saved via the gRPC
> saveFetcher/saveEmitter endpoints are not available to the forked PipesServer
> workers because they use separate ConfigStore instances.
> The TikaGrpcServerImpl creates a ConfigStore from the PipesConfig, but
> PipesServer.initializeResources() loads FetcherManager and EmitterManager
> without passing a ConfigStore, so they create separate in-memory ConfigStores.
> This causes fetchAndParse requests to fail with FetcherNotFoundException even
> after successfully calling saveFetcher.
> The fix is to make PipesServer create and use the same type of ConfigStore
> (from PipesConfig) that TikaGrpcServerImpl uses, so both processes can share
> the runtime configurations.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)