try more often after concurrency conflicts,

pause for longer between tries.
This commit is contained in:
hns 2001-10-11 11:42:38 +00:00
parent 3db1848822
commit 1334833b14

View file

@ -372,12 +372,12 @@ public class RequestEvaluator implements Runnable {
} catch (ConcurrencyException x) { } catch (ConcurrencyException x) {
res.reset (); res.reset ();
if (++tries < 5) { if (++tries < 8) {
// try again after waiting some period // try again after waiting some period
abortTransaction (true); abortTransaction (true);
try { try {
// wait a bit longer with each try // wait a bit longer with each try
int base = 500 * tries; int base = 800 * tries;
Thread.currentThread ().sleep ((long) (base + Math.random ()*base*2)); Thread.currentThread ().sleep ((long) (base + Math.random ()*base*2));
} catch (Exception ignore) {} } catch (Exception ignore) {}
continue; continue;
@ -954,7 +954,8 @@ public class RequestEvaluator implements Runnable {
} }
/** /**
* Get a scripting wrapper object for a user object. Active user objects use different wrapper classes. * Get a scripting wrapper object for a user object. Active user objects are represented by
* the special ESUser wrapper class.
*/ */
public ESNode getNodeWrapper (User u) { public ESNode getNodeWrapper (User u) {
if (u == null) if (u == null)