mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-28 12:37:48 +01:00
Server: don't forget to resend invalidations in case of error
This commit is contained in:
@@ -110,7 +110,7 @@ public class RemoteObjectServiceServerImpl {
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.error(e, e);
|
||||
Log.error("Error handling ops", e);
|
||||
throw e;
|
||||
}
|
||||
return Uni.createFrom().item(OpPushReply.getDefaultInstance());
|
||||
|
||||
@@ -117,7 +117,6 @@ public class InvalidationQueueService {
|
||||
try {
|
||||
ArrayListValuedHashMap<PeerId, Op> ops = new ArrayListValuedHashMap<>();
|
||||
ArrayListValuedHashMap<PeerId, Runnable> commits = new ArrayListValuedHashMap<>();
|
||||
|
||||
for (var e : data) {
|
||||
// TODO: Race?
|
||||
if (!peerInfoService.existsPeer(e.peer())) {
|
||||
@@ -162,6 +161,11 @@ public class InvalidationQueueService {
|
||||
remoteObjectServiceClient.pushOps(p, list);
|
||||
commits.get(p).forEach(Runnable::run);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.warnv("Failed to send invalidations, will retry", e);
|
||||
for (var inv : data) {
|
||||
pushInvalidationToOne(inv);
|
||||
}
|
||||
} finally {
|
||||
locks.forEach(AutoCloseableNoThrow::close);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user