-
Notifications
You must be signed in to change notification settings - Fork 715
fix: Add a timeout for ingestion_service::ingest grpc call #8898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Failed to generate code suggestions for PR |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
Added timeout configuration to internal ingestion gRPC calls to prevent indefinite hangs. The default timeout is set to 600 seconds, matching the query timeout setting.
Key Changes:
- Updated
ZO_QUERY_INGESTER_TIMEOUTdefault from 0 (no timeout) to 600 seconds in config.rs:1295 - Applied timeout to gRPC requests in ingestion_service.rs:40-43 using
request.set_timeout() - Follows existing pattern used in other gRPC clients like
make_grpc_search_clientin infra/src/client/grpc.rs:115
Impact:
- Affects internal ingestion calls from alerts, self-reporting, and cloud events services
- Prevents indefinite blocking on slow or unresponsive ingester nodes
- Improves system resilience and observability
Confidence Score: 5/5
- This PR is safe to merge with minimal risk
- The changes follow established patterns in the codebase, add critical timeout protection to prevent indefinite hangs, and use a reasonable default value that matches the query timeout. The implementation is simple, well-scoped, and addresses a real operational concern.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| src/config/src/config.rs | 5/5 | Changed default value of ZO_QUERY_INGESTER_TIMEOUT from 0 to 600 seconds to match query_timeout |
| src/service/ingestion/ingestion_service.rs | 5/5 | Added timeout configuration to internal ingestion gRPC calls using query_ingester_timeout setting |
Sequence Diagram
sequenceDiagram
participant Caller as Calling Service<br/>(Alerts/SelfReporting)
participant IS as ingestion_service::ingest
participant Config as Configuration
participant Client as IngestClient<br/>(gRPC)
participant Ingester as Remote Ingester Node
Caller->>IS: ingest(IngestionRequest)
IS->>Config: get_config()
Config-->>IS: query_ingester_timeout: 600s
IS->>IS: Create tonic::Request
IS->>IS: Set timeout to 600s
IS->>Client: Configure compression & message size
Client->>Ingester: ingest(request) with 600s timeout
alt Success
Ingester-->>Client: IngestionResponse
Client-->>IS: Ok(response)
IS-->>Caller: Ok(IngestionResponse)
else Timeout or Error
Ingester-->>Client: Error/Timeout
Client-->>IS: Err(e)
IS->>IS: Log error
IS-->>Caller: Err(IngestionError)
end
2 files reviewed, no comments
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 365 | 342 | 0 | 19 | 4 | 94% | 4m 40s |
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 365 | 343 | 0 | 19 | 3 | 94% | 4m 42s |
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 365 | 344 | 0 | 19 | 2 | 94% | 4m 40s |
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 366 | 346 | 0 | 19 | 1 | 95% | 4m 39s |
hengfeiyang
approved these changes
Oct 29, 2025
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 366 | 343 | 0 | 19 | 4 | 94% | 4m 38s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A timeout is added to the ingestion_service::ingest function which is used for internal ingestion. Default value of the new env variable
ZO_GRPC_INGEST_TIMEOUTwhich is used for the above timeout, is 600 seconds