Skip to content

Remove buffer_memory param unsupported in kafka-python 3.x#174

Merged
jhutar merged 1 commit into
mainfrom
fix-remove-buffer-memory
Jun 26, 2026
Merged

Remove buffer_memory param unsupported in kafka-python 3.x#174
jhutar merged 1 commit into
mainfrom
fix-remove-buffer-memory

Conversation

@hyp3rion31gr3y

Copy link
Copy Markdown
Contributor

The buffer_memory producer config was removed in kafka-python 3.0, causing ValueError on pod startup. Drop the parameter from the producer init and the corresponding --kafka-buffer-memory CLI argument.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@hyp3rion31gr3y, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 9 minutes and 51 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 9547b820-b0fd-48b3-9b06-2ecf19cdd030

📥 Commits

Reviewing files that changed from the base of the PR and between bea99b1 and 02c80b3.

📒 Files selected for processing (2)
  • core/opl/args.py
  • extras/opl/kafka_init.py
📝 Walkthrough

Walkthrough

The Kafka CLI no longer defines --kafka-buffer-memory, and Kafka producer setup no longer passes buffer_memory into KafkaProducer.

Changes

Kafka configuration update

Layer / File(s) Summary
Remove buffer memory setting
core/opl/args.py, extras/opl/kafka_init.py
The Kafka argument parser drops --kafka-buffer-memory, and Kafka producer initialization no longer includes buffer_memory in common_params.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: removing the unsupported buffer_memory parameter from kafka-python 3.x.
Description check ✅ Passed The description matches the changeset by explaining the removal of buffer_memory from producer init and the CLI argument.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vishalvvr

vishalvvr commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Hello @hyp3rion31gr3y,
I was checking upgrade docs for kafka-python and I this was mentioned
buffer_memory removed: The buffer_memory config has been removed from KafkaProducer; the deprecation warning emitted in 2.x is now a hard error. Use max_request_size (per-request bound) and let the accumulator manage in-flight memory naturally.

but they also suggested an alternative to use.
max_request_size (per-request bound) instead

https://kafka-python.readthedocs.io/en/stable/upgrade_to_3_0.html#buffer-memory-removed

docs says
max_request_size (int): The maximum size of a request. This is also effectively a cap on the maximum record size. Note that the server has its own cap on record size which may be different from this. This setting will limit the number of record batches the producer will send in a single request to avoid sending huge requests. Default: 1048576.
https://kafka-python.readthedocs.io/en/stable/_modules/kafka/producer/kafka.html#

Please check if this is concerning else ignore :)

Thanks

@hyp3rion31gr3y hyp3rion31gr3y force-pushed the fix-remove-buffer-memory branch from bea99b1 to e7d4021 Compare June 26, 2026 09:07
The buffer_memory producer config was removed in kafka-python 3.0,
causing ValueError on pod startup. Replace it with max_request_size
(per-request bound) as recommended by the kafka-python 3.0 upgrade
docs, and add the corresponding --kafka-max-request-size CLI argument.

According to Claude(for later reference):
● These are fundamentally different parameters, so they shouldn't be set equal:

  - buffer_memory (33554432 = 32 MB) — Total memory pool the producer could use to buffer all unsent records across all partitions. It was an overall memory budget.
  - max_request_size (1048576 = 1 MB) — Maximum size of a single request (effectively the max record size). It's a per-request cap, not a memory pool.

  They control different things, so copying the old 32 MB value into max_request_size would be incorrect — it would allow 32 MB individual requests, which is almost
  certainly not what you want and could hit broker-side message.max.bytes limits.

  The default of 1048576 (1 MB) is kafka-python's own default for max_request_size and aligns with the typical Kafka broker default for message.max.bytes. I'd keep it
  as-is unless you have records larger than 1 MB that need to go through.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hyp3rion31gr3y hyp3rion31gr3y force-pushed the fix-remove-buffer-memory branch from e7d4021 to 02c80b3 Compare June 26, 2026 09:32
@vishalvvr

Copy link
Copy Markdown
Contributor

lgtm

@jhutar jhutar merged commit 29bdf09 into main Jun 26, 2026
7 checks passed
@jhutar

jhutar commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Great, thank you! Also thanks Vishal for cross-checking with release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants