Skip to content

fix(ingestion): document and validate extractor timeout env - #21119

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
jay77721:fix/extractor-chat-timeout-env
Oct 19, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
jay77721:fix/extractor-chat-timeout-env

Conversation

@jay77721

Copy link
Copy Markdown
Member

Summary

Make the Extractor's existing EXTRACTOR_CHAT_TIMEOUT setting discoverable in docker/.env and use the shared environment-variable constant. Reject seconds that overflow time.Duration: previously, 9223372037 wrapped into a negative timeout instead of falling back to the 180-second default.

Related Issue

Follow-up to #21003. No linked issue.

Changes

  • Add common.EnvExtractorChatTimeout and use it in the Extractor and its tests.
  • Document integer seconds, the 180-second default, invalid-value fallback, and the scope: keywords, questions, summary, and metadata. The budget includes retries and backoff; tags use a separate timeout.
  • Parse seconds as a signed 64-bit integer and validate the representable duration range before conversion.
  • Cover whitespace, trimmed overrides, unsupported suffixes, fractional values, and duration/integer overflow boundaries.

Test Plan

  • Confirmed the new duration-overflow regression case failed before the fix.
  • bash build.sh --test ./internal/ingestion/component/ passed, including the script's native unit tests.
  • git diff --check passed.

@jay77721 jay77721 added bug go Pull requests that update go code parsing size:S This PR changes 10-29 lines, ignoring generated files. ci Continue Integration labels Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 650ca2a2-5656-4f24-9a44-0021bb7aaa96
📥 Commits

Reviewing files that changed from the base of the PR and between 543e167 and 4d57b93.

📒 Files selected for processing: 4
  • docker/.env
  • internal/common/environments.go
  • internal/ingestion/component/extractor.go
  • internal/ingestion/component/extractor_call_timeout_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Adds EXTRACTOR_CHAT_TIMEOUT as a shared environment variable. The extractor accepts positive integer seconds when the value fits in a time.Duration; otherwise, it uses the 180-second default. The environment documentation and timeout tests are updated.

Changes: Extractor LLM timeout

Layer / File(s) Summary
Define and validate the timeout
internal/common/environments.go, internal/ingestion/component/extractor.go, internal/ingestion/component/extractor_call_timeout_test.go, docker/.env
Adds the shared environment variable constant and validates positive integer seconds against duration overflow. Tests cover valid values, fallback cases, and use of the shared constant. The environment documentation describes the timeout scope, default, and fallback.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: xugangqiang

Merge Risk: ⚪ Minimal · up to 4d57b

The configured timeout safely falls back for invalid or oversized values and covers the documented extraction operations. Tags use their separate timeout; no actionable merge risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description includes the required Summary section and clearly explains the purpose, background, implementation, validation, and test results. Additional sections provide useful review context.
Title check Passed The title clearly and concisely describes the main changes: documenting and validating the extractor timeout environment variable.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the timeout sign,
And counts the seconds in a line.
Too large, too small, or not quite right,
Returns the default, calm and bright.
The extractor hops along tonight.

Comment @coderabbitai help to get the list of available commands.

@wangq8
wangq8 merged commit 1d2d049 into infiniflow:main Oct 19, 2026
26 checks passed
@jay77721
jay77721 deleted the fix/extractor-chat-timeout-env branch October 20, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci Continue Integration go Pull requests that update go code parsing size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants