querysub 0.610.0 → 0.611.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "querysub",
3
- "version": "0.610.0",
3
+ "version": "0.611.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -24,7 +24,7 @@ import { logDisk } from "../diagnostics/logs/diskLogger";
24
24
  import { MaybePromise } from "socket-function/src/types";
25
25
  import { getPathStr2 } from "../path";
26
26
 
27
- let HEARTBEAT_INTERVAL = timeInMinute * 5;
27
+ let HEARTBEAT_INTERVAL = timeInMinute * 1;
28
28
  // Interval which we check other heartbeats
29
29
  let CHECK_INTERVAL = HEARTBEAT_INTERVAL;
30
30
  // If the heartbeat is older than thing, it fails the dead check
@@ -34,7 +34,7 @@ let DEAD_THRESHOLD = HEARTBEAT_INTERVAL * 2;
34
34
  let DEAD_CHECK_COUNT = 4;
35
35
  // If we find we are unable to write our heartbeat, we have to kill our own process. Otherwise it may
36
36
  // be too out of sync, and might commit unverified data to the disk.
37
- let SUICIDE_HEARTBEAT_THRESHOLD = HEARTBEAT_INTERVAL * 4;
37
+ let SUICIDE_HEARTBEAT_THRESHOLD = Math.max(timeInMinute * 10, HEARTBEAT_INTERVAL * 4);
38
38
 
39
39
  let CLIENTSIDE_POLL_RATE = timeInMinute * 30;
40
40
 
@@ -56,6 +56,7 @@ let DEAD_NODE_POLL_COOLDOWN = timeInMinute * 5;
56
56
 
57
57
  let shutdown = false;
58
58
 
59
+ // NOTE: It's not really required to use buffered archives for this. Previously, our heartbeat interval was five minutes and we could raise it again to five minutes. However, keeping it fast means that if our buffered archives has bugs, we'll notice it pretty quickly because if files disappear, for example, if our node discovery file disappears, processes will terminate themselves, which makes it really obvious that there's a problem, and files should never disappear. So it's kind of a canary to say, hey, there's something wrong with our storage, we need to fix it. Even if one node goes away, its writes should have already been propagated.
59
60
  const archives = lazy(() => getArchives2Buffered("nodes/"));
60
61
 
61
62
  let logging = true;