Skip to content

RoundRobinMasterSlaveLoadBalanceAlgorithm throw an ArrayIndexOutOfBoundsException #1265

Closed
@feelwing1314

Description

For English only, other languages we will close it directly.

Please answer these questions before submitting your issue. Thanks!

Before submit a new issue, please check existed issue first, to make sure your issue is not a duplicated one.

Which version of Sharding-Sphere do you using?

3.0.0.M3

Which project do you using? Sharding-JDBC or Sharding-Proxy?

Sharding-JDBC

Expected behavior

RoundRobinMasterSlaveLoadBalance always be OK

Actual behavior

after roundrobin Integer.MAX_VALUE times, will throw an ArrayIndexOutOfBoundsException.

Reason analyze

the AtomicInteger's getAndIncrement() may produce an negative numbers.

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc

For bug report, please MUST provide the reproduce example codes (such as a github link).

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions