Skip to content

[BUG] Cosmos P2: Idle bulk partitions accumulate flush markers without bound #51139

Open

Description

Describe the bug
Alan Zimmer's November 6, 2026 audit of com.azure:azure-cosmos:4.84.0-beta.1 reports that during idle periods the bulk executor's bufferUntil predicate returns false for periodic flush sentinels. This prevents emission but does not discard the sentinel. Long-lived bulk streams retain the markers in each idle partition's buffer, causing unbounded memory growth. Reported priority: P2.

Exception or Stack Trace
N/A; the reported symptom is unbounded retained control markers.

To Reproduce
Keep a partition idle in a long-lived bulk stream while generating many periodic flush ticks. Inspect retained buffer entries, then submit real operations. The reported isolated Reactor probe retained all 10,000 idle markers and produced a subsequent buffer of 10,002 entries.

Code Snippet
No executable probe supplied. Reported location: BulkExecutor.java:545-564 in the audited source.

Expected behavior
Idle flush control signals do not accumulate in retained buffers. Memory retention remains bounded across many idle ticks, and idle flush ticks do not generate empty HTTP batches.

Screenshots
N/A.

Setup (please complete the following information):

  • OS: Not reported.
  • IDE: Not reported.
  • Library/Libraries: com.azure:azure-cosmos:4.84.0-beta.1.
  • Java version: Not reported.
  • App Server/Environment: Long-lived bulk execution stream with idle partitions.
  • Frameworks: Reactor; exact version not supplied.

Dependency mismatch: Not indicated; dependency tree/logs were not supplied.

Additional context
Proposed fix from the audit: prevent idle control signals from entering the retained buffer.

Regression coverage: generate many idle flush ticks and verify bounded retention, no empty HTTP batches, and correct processing when real operations arrive after the idle interval.

Evidence: Alan reproduced retention at the isolated Reactor-operator level, not in a full bulk executor integration test. No live Cosmos calls or full SDK test suite were run, and no repository files were changed. This issue tracks validation and implementation of the proposed fix, not an already-applied fix.

Information Checklist

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.Cosmos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions