Skip to content

Commit

Permalink
removed timeouts. made the router individual timeout to 1s
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton committed May 9, 2024
1 parent f98ee93 commit f3ec2c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion quickwit/quickwit-ingest/src/ingest_v2/ingester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const MIN_RESET_SHARDS_INTERVAL: Duration = if cfg!(any(test, feature = "testsui
pub(super) const PERSIST_REQUEST_TIMEOUT: Duration = if cfg!(any(test, feature = "testsuite")) {
Duration::from_millis(10)
} else {
Duration::from_secs(6)
Duration::from_secs(1)
};

const DEFAULT_BATCH_NUM_BYTES: usize = 1024 * 1024; // 1 MiB
Expand Down
7 changes: 3 additions & 4 deletions quickwit/quickwit-serve/src/elasticsearch_api/bulk_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use std::collections::HashMap;
use std::time::{Duration, Instant};
use std::time::Instant;

use elasticsearch_dsl::ErrorCause;
use hyper::StatusCode;
use quickwit_config::INGEST_V2_SOURCE_ID;
use quickwit_ingest::IngestRequestV2Builder;
Expand Down Expand Up @@ -131,8 +130,8 @@ pub(crate) async fn elastic_bulk_ingest_v2(
let Some(ingest_request) = ingest_request_opt else {
return Ok(ElasticBulkResponse::default());
};
let ingest_response_v2 = tokio::time::timeout(Duration::from_millis(500), ingest_router.ingest(ingest_request)).await
.map_err(|_| ElasticsearchError::new(StatusCode::REQUEST_TIMEOUT, "router timeout".to_string(), None))??;
let ingest_response_v2 = ingest_router.ingest(ingest_request).await?;

let errors = !ingest_response_v2.failures.is_empty();
let mut items = Vec::new();

Expand Down
1 change: 0 additions & 1 deletion quickwit/quickwit-serve/src/rest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ pub(crate) async fn start_rest_server(
let cors = build_cors(&quickwit_services.node_config.rest_config.cors_allow_origins);

let service = ServiceBuilder::new()
.timeout(Duration::from_millis(500)) // TO NOT MERGE THIS, THIS IS JUST FOR A TEST.
.concurrency_limit(quickwit_common::get_from_env("QW_REST_CONCURRENCY_LIMIT", 5))
.load_shed()
.concurrency_limit(quickwit_common::get_from_env("QW_REST_LOAD_SHED_LIMIT", 30))
Expand Down

0 comments on commit f3ec2c1

Please sign in to comment.