Skip to content

Batch size limit in BatchingHttpInterceptor is not respected, causing HTTP 413 error #6527

Closed
@mengdd

Description

@mengdd

Version

4.2

Summary

When using batching as documented:

apolloClientBuilder.httpBatching(
    maxBatchSize = 10
)

We expected the requests batched would be at most of size 10, but in reality it could exceed the size limit and causing error.

Steps to reproduce the behavior

Steps to Reproduce:

  • Set maxBatchSize = 10
  • Fire 20 concurrent requests quickly
  • Observe the 413 error.

Checking the source code here: BatchingHttpInterceptor

We found when the batch is full and wants to send the requests, the lock actually could not be acquired, due to its still be owned by more requests doing adding to the list.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions