question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logical Problem of sending method

See original GitHub issue

BUG REPORT I found a logical problem while reading source code. The problem method is located in org.apache.rocketmq.client.latency.MQFaultStrategy#selectOneMessageQueue(final TopicPublishInfo tpInfo, final String lastBrokerName).

The first problem is that when code runs into the first for-loop, it basically traverse the list of all message queue, and select one available to return. But when it checks the availability of the broker it got before, here comes the problem. In that checking block, it provides two conditions: null == lastBrokerName || mq.getBrokerName().equals(lastBrokerName). The second condition is the source of my problem. When this condition being triggered, it represents that producer need to re-send message and to pick one queue as target of sending. Meanwhile, this also means that the AVAILABLE broker is just the same broker it used last time, which is NOT AVAILABLE. It seemed to be wrong and should add a ! at start of the second condition. This is the first question.

The second question is, In this method, when calling tpInfo.getQueueIdByBroker(notBestBroker);, it returns an Integer variable named writeQueueNums represents the number of available queues under the notBestBroker for writting messages from producer. And under the situation that writeQueueNums is greater than zero, which means there exists certain amount of available queues, it in success calls ‘tpInfo.selectOneMessageQueue()’ to get an instance of MessageQueue. Then it checks the notBestBroker whether or not be null and set some info for mq. Is there any necessity for this "not-null"check? I don’t think so, for this notBestBroker itself has already been referenced. It’s contradictory and weird.

The 3rd question is that why it remove the notBestBroker from the list of failed(not available ) broker when there is no available queue to write?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
xiangwangchengcommented, Apr 20, 2020

Seems a few guys have already mentioned this topic. See #1938 #1576 #1302 #760. And by now the result of the discussion is no need to fix it.

0reactions
RongtongJincommented, Apr 23, 2020

It is a repeated issue. I will close this issue first. We can discusss in this thread 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Two Generals' Problem - Wikipedia
In the experiment, two generals are only able to communicate with one another by sending a messenger through enemy territory. The experiment asks...
Read more >
A multiple process solution to the logical problem of language ...
Many researchers believe that there is a logical problem at the center of language acquisition theory. According to this analysis, the input to...
Read more >
Shipping method condition logic is not accurate - Drupal
ConditionGroup::evaluate() method returns TRUE if no conditions are passed. If you then use "Only one condition must pass" as the Condition ...
Read more >
The Logical Problem of Language Acquisition: A Probabilistic ...
Our method provides a new research tool, allowing arguments about natural language learnability to be made explicit and quantified for the first ...
Read more >
Logical Problems as a Means of Developing Cognitive ...
We propose a method for generating new logical problems.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found