uohzoaix / spymemcached

Automatically exported from code.google.com/p/spymemcached
0 stars 0 forks source link

Race condition in reconnection attempts #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We are using a two node Memcached cluster in production and have noticed if
we turn both off, sometimes only one node will be reconnected when they
both return.

Looking at the code, there appears to be a race condition in the
'attemptReconnects' method of 'MemcachedConnection'.  Specifically, nodes
queued for reconnection are stored in a SortedMap by their calculated
delay.  If two nodes calculate the same delay, the first will be forgotten
about.

This scenario is easy to reproduce using local Memcached instances on
different ports.

Original issue reported on code.google.com by force.ma...@googlemail.com on 8 Apr 2009 at 11:40

GoogleCodeExporter commented 9 years ago
Thanks for the detailed report.

Original comment by dsalli...@gmail.com on 14 Apr 2009 at 8:59