Skip to content

Add configurable timeout to the consolidation requests#1340

Merged
lfoppiano merged 12 commits into
masterfrom
bugfix/configure-timeout-consolidation
Nov 26, 2025
Merged

Add configurable timeout to the consolidation requests#1340
lfoppiano merged 12 commits into
masterfrom
bugfix/configure-timeout-consolidation

Conversation

@lfoppiano

@lfoppiano lfoppiano commented Sep 27, 2025

Copy link
Copy Markdown
Member

This PR adds a way to configure the timeout of the consolidation service which is by default 60 seconds.

This setting is more likely to be useful for citation consolidations (which, as we mentioned in several occasions, should not be abused), where the service is not fast enough to respond. It will increase the waiting time of Grobid if the consolidation service is slow to answer.

Note: that increasing the timeout require also adjustment in the grobid_client timeout.

@coveralls

coveralls commented Sep 27, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 40.421% (-0.001%) from 40.422%
when pulling 2dd32ef on bugfix/configure-timeout-consolidation
into e1acfc3 on master.

@lfoppiano lfoppiano force-pushed the bugfix/configure-timeout-consolidation branch from 961f8ad to 87b648a Compare November 7, 2025 15:40
@lfoppiano lfoppiano marked this pull request as ready for review November 7, 2025 16:06
@lfoppiano lfoppiano force-pushed the bugfix/configure-timeout-consolidation branch from 5e68606 to ced8246 Compare November 7, 2025 19:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 configurable timeout settings for consolidation service API calls (CrossRef and biblio-glutton), allowing users to control how long GROBID waits for external service responses. The default timeout is 60 seconds, with CrossRef configured at 10 seconds in the default YAML config.

Key changes:

  • Introduces timeoutSec configuration parameters for both CrossRef and Glutton consolidation services
  • Implements timeout configuration in HTTP request handling for both services
  • Updates documentation to explain timeout configuration and warnings about aggressive querying

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
grobid-home/config/grobid.yaml Adds timeout configuration options for glutton (60s) and crossref (10s) services with explanatory comments
grobid-core/src/main/java/org/grobid/core/utilities/GrobidConfig.java Adds timeoutSec fields to CrossrefParameters and HostParameters classes with 60-second defaults
grobid-core/src/main/java/org/grobid/core/utilities/GrobidProperties.java Adds getter methods for retrieving timeout values from configuration
grobid-core/src/main/java/org/grobid/core/utilities/glutton/GluttonRequest.java Implements timeout configuration in HTTP request handling for Glutton service
grobid-core/src/main/java/org/grobid/core/utilities/crossref/CrossrefRequest.java Implements timeout configuration in HTTP request handling for CrossRef service and updates version strings
grobid-core/src/main/java/org/grobid/core/utilities/crossref/CrossrefClient.java Refactors method signatures and naming conventions (unrelated to timeout feature)
grobid-core/src/main/java/org/grobid/core/utilities/Consolidation.java Minor code style improvements
doc/Consolidation.md Adds documentation section explaining timeout configuration with examples and warnings

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

Comment thread grobid-core/src/main/java/org/grobid/core/utilities/glutton/GluttonRequest.java Outdated
Comment thread grobid-core/src/main/java/org/grobid/core/utilities/glutton/GluttonRequest.java Outdated
Comment thread doc/Consolidation.md Outdated
Comment thread grobid-home/config/grobid.yaml Outdated
Comment thread grobid-core/src/main/java/org/grobid/core/utilities/crossref/CrossrefClient.java Outdated
Comment thread grobid-core/src/main/java/org/grobid/core/utilities/GrobidProperties.java Outdated
lfoppiano and others added 5 commits November 11, 2025 12:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 8 out of 8 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 thread doc/Consolidation.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 12 out of 12 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.

@lfoppiano lfoppiano merged commit f7596b3 into master Nov 26, 2025
15 of 17 checks passed
@lfoppiano lfoppiano deleted the bugfix/configure-timeout-consolidation branch November 26, 2025 07:15
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.

3 participants