Skip to content

[Bug] DefaultMQPushConsumer don't clean after start fail #8725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
yuz10 opened this issue Sep 21, 2024 · 0 comments · Fixed by #8726
Closed
3 tasks done

[Bug] DefaultMQPushConsumer don't clean after start fail #8725

yuz10 opened this issue Sep 21, 2024 · 0 comments · Fixed by #8726

Comments

@yuz10
Copy link
Member

yuz10 commented Sep 21, 2024

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

Ubuntu 24.04

RocketMQ version

5.3.0

JDK Version

1.8.0

Describe the Bug

Start the DefaultMQPushConsumer with wrong nameserver address, consumer threads are still running after start fail.

Steps to Reproduce

start the DefaultMQPushConsumer with wrong nameserver address:

    public static void main(String[] args) throws InterruptedException, MQClientException {
        DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("consumerGroup");
        consumer.setNamesrvAddr("1.0.0.1:9876");
        consumer.subscribe("test", "*");
        consumer.registerMessageListener((MessageListenerConcurrently) (msgs, context) -> {
            return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
        });
        try {
            consumer.start();
        } catch (Exception e) {
            e.printStackTrace();
            System.out.printf("state: %s", consumer.getDefaultMQPushConsumerImpl().getServiceState());
        }
    }

What Did You Expect to See?

1、the consumer.start() method throws exception.
2、the state of getDefaultMQPushConsumerImpl is running.
3、the consumer threads "PullMessageService", "RebalaceService" are running, so the process will not exit after main function exits.

What Did You See Instead?

1、the consumer.start() method throws exception.
2、the state of getDefaultMQPushConsumerImpl is not running.
3、the consumer threads are not running.

Additional Context

No response

yuz10 added a commit to yuz10/rocketmq that referenced this issue Sep 21, 2024
yuz10 added a commit that referenced this issue Oct 30, 2024
* [ISSUE #8725]clean DefaultMQPushConsumer after start fail

* clean DefaultLitePullConsumerImpl after start fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant