Skip to content

Adaptive batching timeout calculation mistake #2065

Description

@OnlyDeniko

Hi. I think I found a bug in the timeout calculation when assembling batches. If I'm wrong, please correct me.

Let's look at a simple example of the program. For example, we started assembling a batch at time 0. And each element takes 20 ms to assemble. The timeout is set to 100 ms. After the first iteration, we get 80 ms, after the second, 80 - (40 - 0) = 40 ms, and after the third, our timeout value becomes less than zero (40 - (60 - 0) = -20). Thus, we are done with size 2. There will be no size 3, because of the asyncio.TimeoutError.

Although the correct batch should generally be size 5, because we have only 100 ms and 20 ms to assemble each element.

To fix this error, after 139 lines in this file there must be start=current left so that the calculation is correct.

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