mardi 15 mars 2016

In dally gem, "socket_max_failures" options in not working for write and read operations

I am using dalli 2.7.0.

I faced a problem where the memcache instance became unreachable. When a set request was triggered, it should have timed out in 0.5 seconds (the default timeout), instead the dalli client kept retrying.

On further investigation I found that the failure count is reset on every retry.

Trace :

  1. lib/dalli/server.rb : method write : line 532 - The @sock.write times out.
  2. lib/dalli/server.rb : method failure! : line 209 - The @fail_count is incremented
  3. lib/dalli/server.rb : method failure! : line 215 - Dalli::NetworkError is raised
  4. lib/dalli/client.rb : method perform : line 328 - The transaction is retried
  5. lib/dalli/ring.rb : method server_for_key : line 36 - Server's availability is checked.
  6. lib/dalli/server.rb : method up! : line 243 - The @fail_count is reset.

The loop continues. Am I missing some config or is there a bug in the dalli code. Can you guys help me figure it out.

Aucun commentaire:

Enregistrer un commentaire