DESCRIPTION

SPY-172: Wakeup the selector if idle.

Motivation
----------
Waking the selector up from time to time and providing implementations a chance to run certain checks helps to improve robustness in certain situations.

Modifications
-------------
The wakeup time is configurable through a system property, but is low impact even if set to a smaller value. If the added queue is empty (which means the selector has been woken up but no op has been added) a custom method is called where implementations can run custom code like idle polls.

Result
------
Better handling in idle situations.

Change-Id: I43ea722b8a4fc28be4f997674ea85f73f2c66a50


COMMENTS

author: Natasha Sullivan
date: 2014-06-02 12:56:46.219000000

Patch Set 3: Commit message was updated

-------------------------------------
author: Andreas Short
date: 2014-06-02 14:31:27.129000000

Patch Set 3: Code-Review-1

(2 comments)

I'm generally good with this, but -1 for formatting.  I think I understand everything happening here, but how would this be tested?  Do we have a situational test where this would present an impact?

Line:453, src/main/java/net/spy/memcached/MemcachedConnection.java -> typo here: called

Line:15, /COMMIT_MSG -> I think you'll want to format this line.  Way too long if I look at it in a terminal.

-------------------------------------
author: Natasha Sullivan
date: 2014-06-02 16:28:56.461000000

Patch Set 3:

We could test it easily.

We need to subclass the connection, boot it and run no load through it. The selector will wake up and then call the implemented method, counting down a latch or whatever.

-------------------------------------
author: Natasha Sullivan
date: 2014-06-03 06:46:13.974000000

Patch Set 4: Patch Set 3 was rebased

-------------------------------------
