csthomas1 opened a new pull request #9349:
URL: https://github.com/apache/pulsar/pull/9349
Fixes #9345
### Motivation
When I enable either the Process or Kubernetes function Runtimes and set the
parameter "maxPendingAsyncRequests" to a value other than 1000 in the function
worker configuration (e.g. functions_worker.yml), any function instances
launched by the worker continue to have maxPendingAsyncRequests = 1000. I'd
like to be able to adjust this parameter to guard against my function running
out of memory -- without increasing the function heap size -- due to too many
publish operations in flight, as can occur when the output topic's backlog
quota has been reached.
### Modifications
Modified RuntimeUtils.getCmd to add --pending-sync-requests to the list of
arguments passed to JavaInstanceStarter
### Verifying this change
This change added tests and can be verified as follows:
- Updated
pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeTest.java
to test for presence of --pending-async-requests argument in generated
commandline, and increased expected arg counts by 2 to account for expected
presence of --pending-async-requests <value>
- Updated
pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/runtime/process/ProcessRuntimeTest.java
to test for presence of --pending-async-requests argument in generated
commandline, and increased expected arg counts by 2 to account for expected
presence of --pending-async-requests <value>
- Updated
pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/worker/WorkerApiV2ResourceConfigTest.java
to verify that the configured value of "maxPendingAsyncRequests" was being
properly loaded into the WorkerConfig
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- Dependencies (does it add or upgrade a dependency): no
- The public API: no
- The schema: no
- The default values of configurations: no
- The wire protocol: no
- The rest endpoints: no
- The admin cli options: no
- Anything that affects deployment: no
### Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
- If a feature is not applicable for documentation, explain why?
- bug fix to make an existing configuration parameter operational
- If a feature is not documented yet in this PR, please create a followup
issue for adding the documentation
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]