Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.1-beta
-
Component/s: None
-
Security Level: Public
-
Labels:None
-
Environment:1.0.3
Description
The patch (ViewConnection.java) in the bug http://www.couchbase.com/issues/browse/JCBC-26 fixed the dead loop issue, but it introduced another Shutdown issue.
when calling the shutdown function of CouchbaseClient, it could not shutdown the thread of the ViewConnection.
Public void run() {
While(running) {
If (!reconfiguring) {
Synchronized(threadLock)
{
Boolean hasOps = false;
While(!hasOps) { ==> While(!hasOps && running)
For (viewNode node: couchNodes) {
If (node.hasWriteOps()) {
hasOps = true;
break;
}
}
......
If (!hasOps)
{
threadLock.wait();
}
}
}
If (running) {
handleIO();
}
when calling the shutdown function of CouchbaseClient, it could not shutdown the thread of the ViewConnection.
Public void run() {
While(running) {
If (!reconfiguring) {
Synchronized(threadLock)
{
Boolean hasOps = false;
While(!hasOps) { ==> While(!hasOps && running)
For (viewNode node: couchNodes) {
If (node.hasWriteOps()) {
hasOps = true;
break;
}
}
......
If (!hasOps)
{
threadLock.wait();
}
}
}
If (running) {
handleIO();
}
JCBC-96.