From 94badd28fff06328775eb5cac03a4f4487d43dd2 Mon Sep 17 00:00:00 2001 From: Arne H Juul Date: Thu, 16 Dec 2021 07:30:45 +0000 Subject: start new incremental fetch immediately --- jrt/src/com/yahoo/jrt/slobrok/api/Mirror.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'jrt/src') diff --git a/jrt/src/com/yahoo/jrt/slobrok/api/Mirror.java b/jrt/src/com/yahoo/jrt/slobrok/api/Mirror.java index 51a3c6b6146..369c02554c2 100644 --- a/jrt/src/com/yahoo/jrt/slobrok/api/Mirror.java +++ b/jrt/src/com/yahoo/jrt/slobrok/api/Mirror.java @@ -174,9 +174,11 @@ public class Mirror implements IMirror { if (requestDone) { handleUpdate(); requestDone = false; - return; } + startFetchRequest(); + } + private void startFetchRequest() { if (target != null && ! slobroks.contains(currSlobrok)) { log.log(Level.INFO, "location broker "+currSlobrok+" removed, will disconnect and use one of: "+slobroks); target.close(); @@ -204,7 +206,7 @@ public class Mirror implements IMirror { req.parameters().add(new Int32Value(5000)); // mstimeout target.invokeAsync(req, 40.0, reqWait); } - + private void handleUpdate() { if (!req.checkReturnTypes("iSSSi") || (req.returnValues().get(2).count() != @@ -215,8 +217,7 @@ public class Mirror implements IMirror { " (error code " + req.errorCode() + ")"); } target.close(); - target = null; - updateTask.scheduleNow(); // try next slobrok + target = null; // try next slobrok return; } Values answer = req.returnValues(); @@ -235,7 +236,6 @@ public class Mirror implements IMirror { Entry[] newSpecs; if (diffFromGeneration == 0) { newSpecs = new Entry[numNames]; - for (int idx = 0; idx < numNames; idx++) { newSpecs[idx] = new Entry(n[idx], s[idx]); } @@ -270,7 +270,6 @@ public class Mirror implements IMirror { updates = u; } backOff.reset(); - updateTask.schedule(0.1); // be nice } /** -- cgit v1.2.3