Server: don't forget to resend invalidations in case of error

This commit is contained in:
2025-04-01 13:10:11 +02:00
parent 68111a0c4f
commit 194166109e
2 changed files with 6 additions and 2 deletions

View File

@@ -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());

View File

@@ -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);
}