mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 05:56:47 +00:00
Increment a counter for timeouts rather than logging the full exception
This commit is contained in:
1 parent
fdaba751bd
commit
75532b307c
1 file changed
+11
-4
+11
-4
@@ -61,6 +61,9 @@ public class MessagesManager {
|
||||
private static final String PRESENCE_MATCH_COUNTER_NAME =
|
||||
MetricsUtil.name(MessagesManager.class, "presenceMatch");
|
||||
|
||||
private static final Counter INSERT_TIMEOUT_COUNTER =
|
||||
Metrics.counter(name(MessagesManager.class, "insertTimeout"));
|
||||
|
||||
@VisibleForTesting
|
||||
static final String MIRROR_INSERTS_EXPERIMENT_NAME = "foundationDbMirrorInserts";
|
||||
|
||||
@@ -132,10 +135,14 @@ public class MessagesManager {
|
||||
foundationDbMessageStore.insert(new AciServiceIdentifier(accountIdentifier), minimizedMessagesByDeviceId)
|
||||
.orTimeout(FOUNDATIONDB_INSERT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)
|
||||
.exceptionally(e -> {
|
||||
logger.warn("Failed to insert {} message(s) for {} into FoundationDB",
|
||||
minimizedMessagesByDeviceId.size(),
|
||||
accountIdentifier,
|
||||
e);
|
||||
if (e instanceof TimeoutException) {
|
||||
INSERT_TIMEOUT_COUNTER.increment();
|
||||
} else {
|
||||
logger.warn("Failed to insert {} message(s) for {} into FoundationDB",
|
||||
minimizedMessagesByDeviceId.size(),
|
||||
accountIdentifier,
|
||||
e);
|
||||
}
|
||||
|
||||
return Collections.emptyMap();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user