GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — [Broker] Disable memory limit controller for broker client and replication clients by lhotari · Pull Request #15723 · apache/pulsar Conversation
|
|
@lhotari:Thanks for your contribution. For this PR, do we need to update docs? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@lhotari:Thanks for providing doc info! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is only a partial solution. We should configure all clients with the correct configuration.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
@michaeljmarshall It's intentional that this PR addresses only the replication clients. That's the problem that we have faced. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@lhotari - sorry, I completely missed the configuration name. Do you think it'll make sense long term to have this separate config? I have been thinking about consolidating client configuration in to simplify broker client configuration. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
@michaeljmarshall Good point. After all it might be worth hard coding the setting to 0 for the actual broker client + all replication clients as @merlimat suggested. The benefit of this would be that we don't unnecessarily introduce new settings which aren't useful in the end. I will revisit this PR. We can add the way to configure the limits later. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
6fb1287 to
3c277ce
Compare
…ation clients - disable memory limit by default for broker client and replication clients - restore maxPendingMessages and maxPendingMessagesAcrossPartitions when memory limit is disabled so that pre-PIP-120 default configuration is restored when limit is disabled
3c277ce to
61d4a8c
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
we should add this to branch-2.10
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ation clients (apache#15723) - disable memory limit by default for broker client and replication clients - restore maxPendingMessages and maxPendingMessagesAcrossPartitions when memory limit is disabled so that pre-PIP-120 default configuration is restored when limit is disabled
|
/pulsarbot rerun-failure-checks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ation clients (#15723) - disable memory limit by default for broker client and replication clients - restore maxPendingMessages and maxPendingMessagesAcrossPartitions when memory limit is disabled so that pre-PIP-120 default configuration is restored when limit is disabled
- this method was missing from a56f041
…where unset ### Motivation When the client memory limit is disabled there is no byte-based backpressure left, so apache#15723 gave producers the pre-PIP-120 pending-message defaults instead of letting them buffer without any limit. Its commit message states the intent: "restore maxPendingMessages and maxPendingMessagesAcrossPartitions when memory limit is disabled so that pre-PIP-120 default configuration is restored when limit is disabled". They are defaults, and PIP-120 is the same commit that changed them to 0 and documented 0 as "disable the pending messages check". An application that configures a limit therefore has to keep winning over them, including with an explicit 0. The previous approach seeded the defaults onto the builder in `newProducer(Schema)`, which left three holes: 1. The no-argument `newProducer()` never got them, so the WebSocket proxy's producer handler, the Functions log appender and the Functions worker are unbounded today. 2. A caller that later passed a limit through - a CLI flag or a config value sitting at its own default - silently replaced them. 3. Seeding `maxPendingMessages` to 1000 made a later `maxPendingMessagesAcrossPartitions(500)` throw, which a Functions `ProducerConfig` setting only that limit walks straight into. ### Modifications `maxPendingMessages` is a primitive whose unset value is 0, and 0 is also a meaningful explicit value, so the configuration alone cannot tell "never configured" from "explicitly unbounded". `ProducerBuilderImpl` records which of the two limits the application configured - through the setters or through `loadConf` - and carries that across `clone()`. At producer creation the client fills in only the limits that were never configured, on a copy of the configuration so nothing leaks into the next producer built from the same builder. A limit that is already positive counts as configured however the configuration was populated. Tracking this on the builder rather than on the configuration is not a preference: `loadConf` goes through `ConfigurationDataUtils.loadData`, which rebuilds the configuration by replaying every property through the setters, so a marker held there would be re-set on every call. An explicit `maxPendingMessages(0)` also suppresses the across-partitions default, so one call is enough to ask for a producer with no message-count limit whatever the topic's shape - filling in the budget would put a per-partition limit straight back. The V5 client is deliberately left out. It reaches producer creation through `createSegmentProducerAsync` and exposes no pending-message setting at all, so its client memory limit is the only backpressure it has, and the only thing an application can turn off. The WebSocket proxy takes `maxPendingMessages` from a query parameter and its client has no memory limit by default, so a remote client could now ask for an unbounded pending queue inside the shared proxy. A non-positive value is ignored there. Assisted-by: Claude Code (Opus 5)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Broker] Support configuration of the memory allocated to replication producer
There was an error while loading. Please reload this page.