Skip to content

Commit fb29ec5

Browse files
committed
raised reassembly timeout a bit.
1 parent 2475496 commit fb29ec5

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/mesh/agents/network/SecureNetworkAgent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class SecureNetworkAgent implements Agent {
342342
const toRemove = new Array<string>();
343343

344344
for (const [id, partialMsg] of this.messageFragments.entries()) {
345-
const timeout = Math.max(8000, 400 * partialMsg.fragCount) + partialMsg.created;
345+
const timeout = Math.max(12000, 600 * partialMsg.fragCount) + partialMsg.created;
346346
const updateTimeout = Math.max(timeout, 6000 + partialMsg.updated);
347347
const now = Date.now();
348348

src/mesh/agents/state/history/HistorySynchronizer.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,16 +955,24 @@ class HistorySynchronizer {
955955
try {
956956

957957
// throws if validation fails
958+
const t1 = Date.now()
958959
await HashedObject.fromContextWithValidation(reqInfo.receivedObjects as Context, literal.hash);
960+
const t2 = Date.now()
961+
962+
console.log('validated ' + literal.hash + ' in ' + (t2 - t1) + 'ms')
959963

960964
reqInfo.nextOpSequence = reqInfo.nextOpSequence as number + 1;
961965

966+
const s1 = Date.now()
962967
await this.syncAgent.store.saveWithContext(literal.hash, reqInfo.receivedObjects as Context);
968+
const s2 = Date.now()
969+
970+
console.log('saved ' + literal.hash + ' in ' + (s2 - s1) + 'ms')
963971

964972
// FIXME: there's no validation of the op matching the actual causal history op
965973
// TODO: validate, remove op and all history following if op does not match
966974

967-
this.opXferLog.debug('\n'+this.logPrefix+'\nReceived op ' + literal.hash + ' from request ' + reqInfo.request.requestId);
975+
this.opXferLog.debug('\n'+this.logPrefix+'\nReceived op ' + literal.hash + ' from request ' + reqInfo.request.requestId + '(was requested: ' + (reqInfo.request.requestedOps !== undefined && reqInfo.request.requestedOps.indexOf(literal.hash) >= 0) + ') ');
968976

969977
const removed = this.checkRequestRemoval(reqInfo);
970978

src/storage/store/Store.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ class Store {
347347
}
348348

349349
}
350-
351350
}
352351

353352
async loadLiteral(hash: Hash): Promise<Literal | undefined> {

0 commit comments

Comments
 (0)