Skip to content

Commit

Permalink
[ML] File upload: Increasing timeout for upload request (elastic#191770)
Browse files Browse the repository at this point in the history
When uploading a PDF file with a semantic text field, the bulk ingest
request to elasticsearch can sometimes take longer than the default
timeout. This causes the browser to attempt the upload again, resulting
in duplicate documents.
This change increases the timeout to 1 hour which should be more than
enough time for the processor to complete given the max file sizes we
support.
  • Loading branch information
jgowdyelastic authored Sep 2, 2024
1 parent 52a54f7 commit af9a948
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x-pack/plugins/file_upload/server/import_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ export function importDataProvider({ asCurrentUser }: IScopedClusterClient) {
bulkRequest.pipeline = pipelineId;
}

const resp = await asCurrentUser.bulk(bulkRequest, { maxRetries: 0 });
const resp = await asCurrentUser.bulk(bulkRequest, {
maxRetries: 0,
requestTimeout: 3600000,
});
if (resp.errors) {
throw resp;
} else {
Expand Down

0 comments on commit af9a948

Please sign in to comment.