Skip to content

fix: prevent batch processing hangs on external service timeouts#1578

Merged
gopaljilab merged 11 commits into
gopaljilab:mainfrom
Neelr1912:main
Jun 26, 2026
Merged

fix: prevent batch processing hangs on external service timeouts#1578
gopaljilab merged 11 commits into
gopaljilab:mainfrom
Neelr1912:main

Conversation

@Neelr1912

Copy link
Copy Markdown
Contributor

Description

This PR fixes batch processing hangs caused by external service timeouts and network failures.

Changes Made

  • Added configurable timeout protection for external inference/API requests.

  • Implemented exponential backoff retry logic with configurable retry limits.

  • Prevented failed documents from blocking the remaining processing queue.

  • Added structured warning and error logging for timeout and retry failures.

  • Improved cleanup of active inference requests.

  • Added configuration support for:

    • REQUEST_TIMEOUT
    • MAX_RETRIES
    • RETRY_BACKOFF_FACTOR
  • Added comprehensive tests covering:

    • API timeout handling
    • Network failures
    • Rate limiting (429 responses)
    • Successful retries
    • Retry exhaustion
    • Queue continuation after document failure

Result

A single external service timeout or failure no longer causes the entire batch job to hang indefinitely. Failed documents are handled gracefully while remaining documents continue processing normally.

Closes #1266

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

@Neelr1912 is attempting to deploy a commit to the gopaljilab's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added type:bug Something isn't working or throwing errors. gssoc:approved level:intermediate Requires standard familiarity with the codebase. Reliability labels Jun 20, 2026
@Neelr1912

Copy link
Copy Markdown
Contributor Author

Fixed the lint failure by excluding generated TypeDoc assets (docs/typedoc/**) from ESLint. These files are auto-generated and were producing lint errors unrelated to the application source code. Verified that linting now targets only project source files.

@Neelr1912

Copy link
Copy Markdown
Contributor Author

please merge and closed that I can solve another issue

# Conflicts:
#	package-lock.json
#	server/routes/upload.routes.ts
#	server/services/mlService.ts
@github-actions github-actions Bot added the type:security Vulnerability fixes or security-related enhancements. label Jun 23, 2026
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clinical-insight-engine Ready Ready Preview, Comment Jun 26, 2026 6:23pm

@gopaljilab gopaljilab merged commit 0c52010 into gopaljilab:main Jun 26, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved level:intermediate Requires standard familiarity with the codebase. Reliability type:bug Something isn't working or throwing errors. type:security Vulnerability fixes or security-related enhancements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Batch processing hangs indefinitely on external API or service timeout

2 participants