Skip to content

RequestAbortedError: Request aborted #2022

Closed
@sibelius

Description

@sibelius

🐛 Bug Report

When doing a lot of document indexing in parallel

const esClient = new Client({
      node: config.ELASTICSEARCH,
      maxRetries: 2,
      requestTimeout: 3000,
    });

await esClient.index(document);

it is throwing this error:

RequestAbortedError: Request aborted
at SniffingTransport.request (/us/ src/app/node_modules/@elastic/transport/lib/Transport.js:502:46)
at processTicksAndRejections (node:internal/process/task_ queues :95:5)
at runNextTicks (node:internal/process/task queues :64:3)
at listOnTimeout (node:internal/timers: 540:9)
at process.processTimers (node:internal/timers:514:7) {

To Reproduce

Steps to reproduce the behavior:

Paste your code here:

const esClient = new Client({
      node: config.ELASTICSEARCH,
      maxRetries: 2,
      requestTimeout: 3000,
    });

await esClient.index(document);

Try to index a lot of documents at the same time: 10k or more at the same time

Expected behavior

It should work.
It should reuse connections
maybe old keepAlive option helped

is there better way to start an elastic search client for production use?

Paste the results here:

not working

Your Environment

  • node version: 16, 18, 20
  • @elastic/elasticsearch version: 8.9.0
  • os: mac and linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions