You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "jujiale (via GitHub)" <gi...@apache.org> on 2025/04/30 06:30:02 UTC

[I] [Bug] one service module consumers all get blocked under the same namespace [pulsar]

jujiale opened a new issue, #24231:
URL: https://github.com/apache/pulsar/issues/24231

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Read release policy
   
   - [x] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
   
   
   ### Version
   
   pulsar-server: both v2.8.1  and  v3.0.10 also have this scenario
   client: pulsar-client-go v0.12.0
   
   ### Minimal reproduce step
   
   cannot find reproduce step
   
   ### What did you expect to see?
   
   consumer could resume msg normally
   
   ### What did you see instead?
   
   under the same namespace, in one module all the consumer could not consumer msg, seems consume blocked
   
   ### Anything else?
   
   let me explain we suffered this scenario.
   1.our scenario is use pulsar to build our eventbridge, it has three modules(the three module topic under one namespace-**eventbridge**). a: **eventbridge-preprocessor**(used to accept all the events, including valid schema...)  b:**eventbridge-ruleengine**.(used to match the rules. if one msg matched the rules, it will send to the rule's related topic)   c:**eventbridge-processor**.(used to get ruleengine model msg , then send it to consumer, the consumer may use http or pulsar to receive the msg), the three module deliver msg use pulsar.
   
   2. the msg procedure like below:
    **eventsource(other web service)   ->  eventbridge-preprocessor   -> eventbridge-ruleengine -> eventbridge-processor-> other web service consumers**
   
   3.the module **eventbridge-processor**  because it send msg to other web service consumers, consider the web service consumers may not reach(such as port could not reach...), we use pulsar retry queue and dlq, such as below:
   `
   
          pulsarClient.Subscribe(pulsar.ConsumerOptions{
                   // this method only construct a string, use it as topic name and SubscriptionName
       		Topic:             common.GetEventbridgeRuleTopicNameV2(target.Rule.Eventbridge.Name, target.Rule.Eventbridge.ID, target.Rule.Name, target.Rule.ID),
       		SubscriptionName:  common.GetEventbridgeTargetSubscriptionNameV2(target.Name, target.ID),
       		Type:              pulsar.Shared,
       		RetryEnable:       true,
       		NackBackoffPolicy: ExponentialNackBackoffRetryPolicy{},
       		DLQ: &pulsar.DLQPolicy{
       			MaxDeliveries: 20,
       			DeadLetterTopic: common.GetEventbridgeTargetDLQTopicNameV2(
       				common.GetEventbridgeRuleTopicNameV2(target.Rule.Eventbridge.Name, target.Rule.Eventbridge.ID, target.Rule.Name, target.Rule.ID),
       				target.Name,
       				target.ID,
       			),
       			RetryLetterTopic: common.GetEventbridgeTargetRetryTopicNameV2(
       				common.GetEventbridgeRuleTopicNameV2(target.Rule.Eventbridge.Name, target.Rule.Eventbridge.ID, target.Rule.Name, target.Rule.ID),
       				target.Name,
       				target.ID,
       			),
       			InitSubscriptionName: "default",
       		},
       	})
   
   
       if err != nil {
       		return nil, err
       	}
       
       	// This is very hacking. Remove when pulsar upgrade is done
       	dlqConsumer, err := pulsarClient.Subscribe(pulsar.ConsumerOptions{
       		Topic: common.GetEventbridgeTargetDLQTopicNameV2(
       			common.GetEventbridgeRuleTopicNameV2(target.Rule.Eventbridge.Name, target.Rule.Eventbridge.ID, target.Rule.Name, target.Rule.ID),
       			target.Name,
       			target.ID,
       		),
       		SubscriptionName: "default",
       		Type:             pulsar.Shared,
       	})
   
   `
   
   4. on some situation, the module **"eventbridge-processor"** not consumer msg which comes from **"eventbridge-ruleengine"**,and even we restart the module **"eventbridge-processor"**, after it started, it may consumer only 3 or 4 seconds msg, soon it get blocked, the msg topic fall in backlog.
   5. this scenario appears three or four times in our prd env, last night, one web service consumer could not reach, module **"eventbridge-processor"** began retry, but after some time, all the topic under the **"eventbridge-processor"** get blocked, event if we restart the module could not recover. it could not resume msg from module **"eventbridge-ruleengine"** topic 
   6. eventually, we deleted all the topic under the namespace **"eventbridge"** and restart the module, everything is recover
   7. because we didnot reproducer it in our dev env, so I want to know why this scenario happen.
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "jujiale (via GitHub)" <gi...@apache.org>.
jujiale commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2840969914

   the backlog like below, eventually we delete the topic under the namespace
   
   ![Image](https://github.com/user-attachments/assets/2066c890-7297-48d9-a138-34c8001c95ca)
   
   and find msg seems unacked
   
   ![Image](https://github.com/user-attachments/assets/173d3790-7b79-4dba-bb2f-3ab5fee17720)


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "jujiale (via GitHub)" <gi...@apache.org>.
jujiale commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2841252921

   some code logic as below:
   `
   
       go func() {
   				defer func() {
   					<-ch
   				}()
   				err := sender.ConvertAndSendMsg(msg)
   				if err != nil {
   					
   					a.Consumer.Nack(msg)
                                          // record metrics
   					tc.MessageDiscard.Inc()
   					}
   					return
   				}
   				err = a.Consumer.Ack(msg)
    
                                   if err != nil {...}
   
   `


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "jujiale (via GitHub)" <gi...@apache.org>.
jujiale commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2841246839

   > [@jujiale](https://github.com/jujiale) do you acknowledge your messages after handled? If not, you may be blocked.
   
   Yes  I handled, but what makes me confused is if msg handle failed, I invoke the unAck and added log, but I find in my prd log, there is no unack log appeared, but the metrics indicate there are many unacked msg.
   
   and you mentioned if unack, this scenario may be occured. I want to know why could block the namespace level.


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2842346623

   The pulsar limits the unacknowledged messages count to avoid high loads.
   
   It would be helpful: https://github.com/apache/pulsar/blob/v3.0.11/conf/broker.conf#L335-L355


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2846449754

   > pulsar-server: both v2.8.1 and v3.0.10 also have this scenario
   > client: pulsar-client-go v0.12.0
   
   @jujiale "pulsar-client-go v0.12.0" is outdated. Does the problem reproduce with [v0.15.0](https://github.com/apache/pulsar-client-go/releases/tag/v0.15.0) and Pulsar broker [3.0.11 or 4.0.4](https://pulsar.apache.org/download/) ? 
   I hope you can test with latest releases since in the OSS project we don't support older versions and expect reporters to test with latest maintained versions to help maintain the project.


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "jujiale (via GitHub)" <gi...@apache.org>.
jujiale commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2865721960

   @nodece @lhotari  hello, I find after we upgrade pulsar-go-client from 0.12.0 to 0.15.0, the problem is disappeared, so I send a issue in pulsar-client-go client, we could reproduce these problem. so I want to know which problem that 0.12.0 contains. if you have time, please take a look at #https://github.com/apache/pulsar-client-go/issues/1362, thanks


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2841163928

   @jujiale do you acknowledge your messages after handled? If not, you may be blocked.


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "jujiale (via GitHub)" <gi...@apache.org>.
jujiale commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2866205330

   > [@jujiale](https://github.com/jujiale) Do you mean that the problem is fixed with pulsar-client-g 0.15.0 version? I replied [in the issue that you created](https://github.com/apache/pulsar-client-go/issues/1362#issuecomment-2866186912).
   
   @lhotari  hello, thanks for your reply. Based on the current test results, the test code have processed 4 hours, the problem have never occured.  I will use 0.15.0 to sustain test util next monday, now, I want to know in 0.15.0, what changes may fix this.


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2866191746

   > [@nodece](https://github.com/nodece) [@lhotari](https://github.com/lhotari) hello, I find after we upgrade pulsar-go-client from 0.12.0 to 0.15.0, the problem is disappeared, so I send a issue in pulsar-client-go client, we could reproduce these problem. so I want to know which problem that 0.12.0 contains. if you have time, please take a look at #[apache/pulsar-client-go#1362](https://github.com/apache/pulsar-client-go/issues/1362), thanks
   
   I'll close this Pulsar issue since it's not a problem in the broker.
   
   @jujiale Do you mean that the problem is fixed with pulsar-client-g 0.15.0 version? I replied [in the issue that you created](https://github.com/apache/pulsar-client-go/issues/1362#issuecomment-2866186912).
   
   


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed issue #24231: [Bug] one service module consumers all get blocked under the same namespace
URL: https://github.com/apache/pulsar/issues/24231


-- 
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] one service module consumers all get blocked under the same namespace [pulsar]

Posted by "jujiale (via GitHub)" <gi...@apache.org>.
jujiale commented on issue #24231:
URL: https://github.com/apache/pulsar/issues/24231#issuecomment-2841265378

   @nodece I just check our log, find because web service consumer could not reach, I invoked the unack method, and the msg count is very large


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