flyerhzm / redis-sentinel

another redis automatic master/slave failover solution for ruby by using built-in redis sentinel (deprecated)
MIT License
188 stars 67 forks source link

uniq! function returns nil. it returns nil at jruby #35

Closed juneng603 closed 10 years ago

juneng603 commented 10 years ago

Hi, all

There is a missed implementation at jruby 1.7.10 (also 1.7.9) the uniq! function for an array doesn't work properly.

please, check this issue. https://github.com/jruby/jruby/issues/1434

so, here is a workaround-way to use the library in a jruby environment.

It works fine.

flyerhzm commented 10 years ago

@junyoungkim I don't think it makes any sense, refresh_sentinels_list doesn't care about the return value.

juneng603 commented 10 years ago

@flyerhzm hi, yes. You're right. This changes are just to fix npe. The last element of block is nil, not element of the array.

juneng603 commented 10 years ago

And this situation is only occurred at jruby, not ruby.

flyerhzm commented 10 years ago

@junyoungkim I mean refresh_sentinels_list doesn't expect to have any return value, it just expect @sentinels_options to be updated.

juneng603 commented 10 years ago

@flyerhzm Yes, i know what u mean. ;) The problem what I want fix is not logic itself. Just to suggest a workaround way to avoid a bug in jruby environments.

kylev commented 10 years ago

Note: The JRuby bug was fixed in 1.7.11.

flyerhzm commented 10 years ago

@kylev good to know, thanks