RobertIndie opened a new pull request, #17795:
URL: https://github.com/apache/pulsar/pull/17795
<!--
### Contribution Checklist
- PR title format should be *[type][component] summary*. For details, see
*[Guideline - Pulsar PR Naming
Convention](https://docs.google.com/document/d/1d8Pw6ZbWk-_pCKdOmdvx9rnhPiyuxwq60_TrD68d7BA/edit#heading=h.trs9rsex3xom)*.
- Fill out the template below to describe the changes contributed by the
pull request. That will give reviewers the context they need to do the review.
- Each pull request should address only one issue, not mix up code from
multiple issues.
- Each commit in the pull request has a meaningful commit message
- Once all items of the checklist are addressed, remove the above text and
this checklist, leaving only the filled out template below.
-->
Fixes #17446
### Motivation
When the `isBlockIfQueueFull` is enabled for the producer, if the producer
sends a very large message(# of total chunks > maxPendingMessages) or the
producer sends too many large messages concurrently, there will be deadlock
when the producer tries too acquire the permit before publishing these messages.
The root cause is that the producer will try to acquire all permits for all
chunks before publishing them. It will be blocked if there are not enough
permits. For example, if the payload size of the message is 55 MB which will be
split into 11 chunks and the maxPendingMessages size is 10, it will be blocked
forever. Even if the message is not too large(like 30MB) but sends 5 such
messages concurrently, it may also be blocked forever.
### Modifications
* If the `BlockIfQueueFull` is enabled, the producer will only acquire a
single permit for each chunk before publishing them.
This PR only affects the case of `BlockIfQueueFull` enabled when sending
chunked messages, and it will not affect other existing behaviors.
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
This change added tests.
### Does this pull request potentially affect one of the following parts:
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc-required`
(Your PR needs to update docs and you will update later)
- [x] `doc-not-needed`
(Please explain why)
- [ ] `doc`
(Your PR contains doc changes)
- [ ] `doc-complete`
(Docs have been already added)
### Matching PR in forked repository
PR in forked repository: https://github.com/RobertIndie/pulsar/pull/5
After opening this PR, the build in apache/pulsar will fail and instructions
will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since
the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed
in
a forked repository.
The tests will be run in the forked repository until all PR review comments
have
been handled, the tests pass and the PR is approved by a reviewer.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]