Skip to content

Helpers for bulk method such as async_bulk sleep in blocking manner, preventing graceful shutdown #2484

Open
@artem-shelkovnikov

Description

@artem-shelkovnikov

We tried using async_bulk and async_streaming_bulk helpers to ingest data into Elasticsearch and they work great, but we've found out that they prevent our code from gracefully shutting down when CTRL+C is pressed.

Example code that sleeps:

await asyncio.sleep(
min(max_backoff, initial_backoff * 2 ** (attempt - 1))
)

It would be great to have a way to:

  • Either define how the sleep happens by passing sleep function into the client
  • Make Elasticsearch client internally cancel all sleeps when the client is closed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions