You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2025/04/29 11:35:31 UTC
[I] REST API publisher by-passes producer rate limiting and memory limits [pulsar]
lhotari opened a new issue, #24229:
URL: https://github.com/apache/pulsar/issues/24229
> Another problem is flow control / back pressure. The REST publisher by-passes all ordinary ways that Pulsar broker handles back pressure for clients and that would result in OOMEs too when clients push more messages than the broker can keep up with. For example, the `maxMessagePublishBufferSizeInMB` gets ignored completely.
>
_Originally posted by @lhotari in [#24227](https://github.com/apache/pulsar/issues/24227#issuecomment-2838192701)_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] REST API publisher by-passes producer rate limiting / memory limits and lacks back pressure [pulsar]
Posted by "JonSnow1807 (via GitHub) via commits" <co...@pulsar.apache.org>.
JonSnow1807 commented on issue #24229:
URL: https://github.com/apache/pulsar/issues/24229#issuecomment-6830355309
I'd like to pick this up, building on the fact that REST contexts now always complete, so the accounting can't leak:
- Count REST message bytes against `maxMessagePublishBufferSizeInMB` (one IO thread's share) until it's persisted.
- Charge REST messages to the topic's publish rate limiters.
- A REST request can't be paused like a producer. When the buffer is full or a target partition is out of quota, reject the whole request with 429 before publishing anything, so retries can't duplicate.
My patch has tests: with bookie adds stalled, a REST flood held 100 MiB in flight before, 16 MiB after. Is 429 right for both, or would you prefer a different code for the rate-limit case?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] REST API publisher by-passes producer rate limiting / memory limits and lacks back pressure [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on issue #24229:
URL: https://github.com/apache/pulsar/issues/24229#issuecomment-6378783941
Still present on master. `TopicsBase.publishSingleMessageToPartition` (pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/TopicsBase.java:268-283 on master) writes straight to `Topic.publishMessage` with a `RestMessagePublishContext`. That skips the `Producer`/`ServerCnx` path, where publish rate limits, `maxMessagePublishBufferSizeInMB` and connection throttling apply, and there is still a `TODO` for the backlog check. A REST client can therefore push messages faster than the broker persists them, with nothing to make it wait. A likely fix is to account REST publishes against the broker publish buffer and topic rate limiters, and to reply 429/503 when they are exceeded, instead of queueing without limit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org