-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Labels
area/cluster-flowIssues or PRs related to cluster flow controlIssues or PRs related to cluster flow controlgood first issueGood for newcomersGood for newcomerskind/bugCategory issues or prs related to bug.Category issues or prs related to bug.
Description
Issue Description
Type: bug report
NettyTransportClient.getCurrentId
private int getCurrentId() {
if (idGenerator.get() > MAX_ID) {
idGenerator.set(0);
}
return idGenerator.incrementAndGet();
}个人理解这个ID应该是用于协议纠错,getCurrentId的目的是为了循环产生ID,且在循环周期内不重复,即生成ID为1,2,3 ... -> MAX -> 1,2,3 ...。
Describe what happened (or what feature you want)
当前的实现,由于MAX -> MIN 的过程不是一个原子操作,生成的ID可能会出现1,2,3 ... -> MAX -> 1,1,2,3 ...的情况。
Describe what you expected to happen
How to reproduce it (as minimally and precisely as possible)
Tell us your environment
Anything else we need to know?
Metadata
Metadata
Assignees
Labels
area/cluster-flowIssues or PRs related to cluster flow controlIssues or PRs related to cluster flow controlgood first issueGood for newcomersGood for newcomerskind/bugCategory issues or prs related to bug.Category issues or prs related to bug.