[
https://issues.apache.org/jira/browse/ROCKETMQ-2?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15768762#comment-15768762
]
Roman Shtykh commented on ROCKETMQ-2:
-------------------------------------
[~vongosling] This fixes the problem that happens when you restart the broker
controller by closing the channel (anyway, if there's no special reason it's
good to close it). But you cannot write the test for it because
{{AcceptSocketService#beginAccept()}} swallows the exception.
The solution is to make {{AcceptSocketService#beginAccept()}} propagate the
exception up, so we can catch it, and this will make writing the test possible.
{{AcceptSocketService#beginAccept()}} can potentially throw many kinds of
exceptions, let's not swallow them. I added the modifications and
{{BrokerControllerTest#testRestart()}}. Please have a look.
Actually, even without adding this test, enabling exception propagation fails
all tests for the broker controller, which shows again that swallowing the
exceptions were just hiding them ;)
> Broker tests fail with "Address already in use"
> -----------------------------------------------
>
> Key: ROCKETMQ-2
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-2
> Project: Apache RocketMQ
> Issue Type: Bug
> Environment: Linux
> Reporter: Roman Shtykh
>
> Execute {{mvn test}} in {{rocketmq-broker/}} to reproduce.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)