mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-25 14:21:33 +02:00
Resolve false probing timeout by delaying the proble a little bit
Change-Id: Ib087f72fa742c614e8b6916a9ea0be4ee08ab064 (cherry picked from commit 17a200e0c12fefe03978c2a595905a7e3bf87171)
This commit is contained in:
parent
8e786b5ed9
commit
bb86b78a34
@ -108,7 +108,7 @@ public class DistributedHostStore
|
||||
private Consumer<Status> statusChangeListener;
|
||||
|
||||
// TODO make this configurable
|
||||
private static final int PROBE_TIMEOUT_MS = 1000;
|
||||
private static final int PROBE_TIMEOUT_MS = 1500;
|
||||
|
||||
private Cache<MacAddress, PendingHostLocation> pendingHostsCache = CacheBuilder.newBuilder()
|
||||
.expireAfterWrite(PROBE_TIMEOUT_MS, TimeUnit.MILLISECONDS)
|
||||
|
||||
@ -90,6 +90,9 @@ import java.util.Dictionary;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.Set;
|
||||
|
||||
@ -447,7 +450,10 @@ public class HostLocationProvider extends AbstractProvider implements HostProvid
|
||||
IPv6.getMCastMacAddress(ip.getIp6Address().toOctets()),
|
||||
host.id().vlanId());
|
||||
}
|
||||
sendProbe(probe, location);
|
||||
|
||||
// NOTE: delay the probe a little bit to wait for the store synchronization is done
|
||||
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
|
||||
executorService.schedule(() -> sendProbe(probe, location), 1000, TimeUnit.MILLISECONDS);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user