You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lifepuzzlefun (via GitHub)" <gi...@apache.org> on 2023/03/26 10:15:35 UTC

[GitHub] [pulsar] lifepuzzlefun opened a new pull request, #19930: [fix] [client] fix deadProducer create callback blocking client io thread.

lifepuzzlefun opened a new pull request, #19930:
URL: https://github.com/apache/pulsar/pull/19930

   
   <!-- Either this PR fixes an issue, -->
   
   Fixes #xyz
   
   ### Motivation
   
   When deadLetterProducer is created. the code maybe run in pulsar-client-io thread.
   
   when the producerCreateFuture trigger callback
   
   we still on the pulsar-client-io thread.
   
   and `retryMesage.getReaderSchema` maybe a blocking call to send rpc to retrieve schema. so the pulsar-client-io thread is blocked. and won't be liveliness because the schema retrieve rpc need io-thread to do the job to get the result.
   
   ### Modifications
   
   execute CompletableFuture callback logic on fork-join-common-pool.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *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 threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] lhotari closed pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.
URL: https://github.com/apache/pulsar/pull/19930


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


[GitHub] [pulsar] Technoboy- merged pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- merged PR #19930:
URL: https://github.com/apache/pulsar/pull/19930


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


[GitHub] [pulsar] codecov-commenter commented on pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #19930:
URL: https://github.com/apache/pulsar/pull/19930#issuecomment-1497082272

   ## [Codecov](https://codecov.io/gh/apache/pulsar/pull/19930?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#19930](https://codecov.io/gh/apache/pulsar/pull/19930?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (54ef5ce) into [master](https://codecov.io/gh/apache/pulsar/commit/329e80b847bd6584cbb031a96d5416d4df488432?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (329e80b) will **increase** coverage by `11.24%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/pulsar/pull/19930/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/pulsar/pull/19930?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@              Coverage Diff              @@
   ##             master   #19930       +/-   ##
   =============================================
   + Coverage     61.50%   72.74%   +11.24%     
   - Complexity    25755    31978     +6223     
   =============================================
     Files          1859     1863        +4     
     Lines        136792   140065     +3273     
     Branches      15043    15792      +749     
   =============================================
   + Hits          84129   101886    +17757     
   + Misses        44857    30072    -14785     
   - Partials       7806     8107      +301     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | inttests | `24.34% <66.66%> (-0.15%)` | :arrow_down: |
   | systests | `25.04% <0.00%> (+0.02%)` | :arrow_up: |
   | unittests | `71.99% <100.00%> (+13.34%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/pulsar/pull/19930?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...va/org/apache/pulsar/client/impl/ConsumerImpl.java](https://codecov.io/gh/apache/pulsar/pull/19930?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NvbnN1bWVySW1wbC5qYXZh) | `76.53% <100.00%> (+10.38%)` | :arrow_up: |
   
   ... and [629 files with indirect coverage changes](https://codecov.io/gh/apache/pulsar/pull/19930/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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


[GitHub] [pulsar] Technoboy- closed pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.
URL: https://github.com/apache/pulsar/pull/19930


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


[GitHub] [pulsar] coderzc commented on a diff in pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.

Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #19930:
URL: https://github.com/apache/pulsar/pull/19930#discussion_r1150288632


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -649,7 +649,7 @@ protected CompletableFuture<Void> doReconsumeLater(Message<?> message, AckType a
                 if (reconsumeTimes > this.deadLetterPolicy.getMaxRedeliverCount()
                         && StringUtils.isNotBlank(deadLetterPolicy.getDeadLetterTopic())) {
                     initDeadLetterProducerIfNeeded();
-                    deadLetterProducer.thenAccept(dlqProducer -> {
+                    deadLetterProducer.thenAcceptAsync(dlqProducer -> {

Review Comment:
   It seems can use `internalPinnedExecutor` execution.



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


[GitHub] [pulsar] lifepuzzlefun commented on a diff in pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.

Posted by "lifepuzzlefun (via GitHub)" <gi...@apache.org>.
lifepuzzlefun commented on code in PR #19930:
URL: https://github.com/apache/pulsar/pull/19930#discussion_r1154080507


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -649,7 +649,7 @@ protected CompletableFuture<Void> doReconsumeLater(Message<?> message, AckType a
                 if (reconsumeTimes > this.deadLetterPolicy.getMaxRedeliverCount()
                         && StringUtils.isNotBlank(deadLetterPolicy.getDeadLetterTopic())) {
                     initDeadLetterProducerIfNeeded();
-                    deadLetterProducer.thenAccept(dlqProducer -> {
+                    deadLetterProducer.thenAcceptAsync(dlqProducer -> {

Review Comment:
   changed to internalPinnedExecutor



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


[GitHub] [pulsar] lhotari commented on pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #19930:
URL: https://github.com/apache/pulsar/pull/19930#issuecomment-1496992446

   Closing and reopening to trigger a new build.


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


[GitHub] [pulsar] Technoboy- commented on a diff in pull request #19930: [fix][client] Fix DeadLetterProducer creation callback blocking client io thread.

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on code in PR #19930:
URL: https://github.com/apache/pulsar/pull/19930#discussion_r1151944591


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -649,7 +649,7 @@ protected CompletableFuture<Void> doReconsumeLater(Message<?> message, AckType a
                 if (reconsumeTimes > this.deadLetterPolicy.getMaxRedeliverCount()
                         && StringUtils.isNotBlank(deadLetterPolicy.getDeadLetterTopic())) {
                     initDeadLetterProducerIfNeeded();
-                    deadLetterProducer.thenAccept(dlqProducer -> {
+                    deadLetterProducer.thenAcceptAsync(dlqProducer -> {

Review Comment:
   yes, agree



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