You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2026/10/17 02:18:47 UTC

Re: [PR] [improve][fn] Provide a way to set Pulsar client memory limit in Pulsar Function [pulsar]

merlimat commented on PR #23959:
URL: https://github.com/apache/pulsar/pull/23959#issuecomment-6228415894

   This PR had been idle since the last re-review request, so I continued it on this branch. @walkinggo's commits are kept as they were. I merged current `master` (no rebase) and added one commit on top. The changes since the last review:
   
   - **Merge with `master`:** the functions protos are now LightProto, and `FunctionDetails` field 24 is taken by `clientApi`, so the limit is field 25.
   - **The limit now reaches process/Kubernetes instances.** `FunctionActioner` uses the function's limit, or else the new `WorkerConfig` default. `RuntimeUtils.getCmd` passes it as `--pulsar_client_memory_limit_bytes` / `--pulsar_client_memory_limit_percent`, and `JavaInstanceStarter` reads these flags. The earlier `--memory_limit` option had no converter and nothing passed it to the instance.
   - **The field is renamed to `pulsarClientMemoryLimit`** in `FunctionConfig` and the proto, to match `InstanceConfig`/`WorkerConfig`. The conversions are fixed: a partially set limit no longer throws an NPE, `convertFromDetails` keeps the limit, function updates merge it, and invalid values are rejected when the function is submitted.
   - **`ThreadRuntimeFactoryConfig.MemoryLimit` (`absoluteValue`) is restored**, so existing `functions_worker.yml` files keep working. The thread runtime falls back to the worker default when it isn't set. `MemoryLimit` stays a plain DTO without a Netty dependency, as agreed in the review.
   - **Added the `pulsar-admin functions` flags** `--client-memory-limit` / `--client-memory-limit-percent`, plus tests for each part.
   
   The PR description is updated with the full write-up.
   


-- 
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