[SPY-114] Thread.interrupt() of CacheLoader results in perpetual loop Created: 20/Mar/13  Updated: 07/Nov/14

Status: Open
Project: Spymemcached Java Client
Component/s: library
Affects Version/s: 2.7.3, 2.8.12
Fix Version/s: .next
Security Level: Public

Type: Bug Priority: Minor
Reporter: Jonathan Leech Assignee: Michael Nitschinger
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

I interrupted a Thread running CacheLoader.loadData(), and observe the behavior that it never finishes loadData(), but rather perpetually re-interrupts itself. I looked at the code and found the offending block in CacheLoader.push(), line 124. I believe it needs to break out of the loop.

Comment by Jonathan Leech [ 20/Mar/13 ]
I believe all that's necessary to fix it is a break; after line 124 on CacheLoader.java. It might make sense to abort the rest of the loadData, either by checking the interrupted status of the thread or to let the InterruptedException progagate out of push() and handle it in loadData.
Comment by Tug Grall (Inactive) [ 22/Mar/13 ]
this is related to forum post : http://www.couchbase.com/forums/thread/cacheloader-bug-jira-broken
Comment by Jonathan Leech [ 03/Feb/14 ]
Had this happen a couple more times recently in our production environment, can I submit a patch? This time, our glassfish container interrupted the threads after 2 hours of inactivity, so there's probably another issue lurking somewhere that caused CacheLoder.loadData to hang for 2 hours...
Comment by Michael Nitschinger [ 07/Nov/14 ]
Sure, if you can provide a patch that would be great.
Generated at Mon Nov 24 14:11:02 CST 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.