Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HW-53073: Allow Thread Interruption for WriteLockManager #1

Open
wants to merge 14 commits into
base: 2.7
Choose a base branch
from
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.iml
.idea/*
.DS_Store
*.class
*test.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;

import org.eclipse.persistence.descriptors.ClassDescriptor;
import org.eclipse.persistence.descriptors.FetchGroupManager;
Expand Down Expand Up @@ -60,6 +61,7 @@
* @since 10.0.3
*/
public class WriteLockManager {
private static Logger logger = Logger.getLogger(WriteLockManager.class.getSimpleName());

// this will allow us to prevent a readlock thread from looping forever.
public static final int MAXTRIES = 10000;
Expand All @@ -72,6 +74,8 @@ public class WriteLockManager {

public WriteLockManager() {
this.prevailingQueue = new ExposedNodeLinkedList();
logger.warning("THIS IS A CUSTOM FORK FOR ECLIPSELINK v2.7.3");

}

/**
Expand All @@ -98,7 +102,9 @@ public Map acquireLocksForClone(Object objectForClone, ClassDescriptor descripto
toWaitOn.wait();// wait for lock on object to be released
}
} catch (InterruptedException ex) {
// Ignore exception thread should continue.
//https://jira.site1.hyperwallet.local/browse/HW-53073
//Custom change to allow thread interruptions for bad threads stuck in org.eclipse.persistence.internal.helper.WriteLockManager.acquireLocksForClone pattern
jportner-hw marked this conversation as resolved.
Show resolved Hide resolved
throw org.eclipse.persistence.exceptions.ConcurrencyException.waitWasInterrupted(ex.getMessage());
}
}
Object waitObject = toWaitOn.getObject();
Expand Down