@zukhruf/election 0.8.76 → 0.8.77

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/README.md CHANGED
@@ -79,8 +79,8 @@ await using term = await election.campaign({ timeout: Infinity, signal });
79
79
  - **The leader record.** The winner writes `<claimFile>.leader` beside `claimFile`, before its term begins. It holds the epoch of the term, the process id of the leader, the address of its pipe, and its `leaseDuration`. The winner first removes the socket file of the pipe that the old record names, which a killed leader leaves ([ADR 0005](./docs/adr/0005-the-leader-record-names-the-process-and-the-pipe-of-a-term.md)).
80
80
  - **The wait.** A candidate tries the claim. When another candidate holds it, the candidate reads the record, connects to the pipe, and waits. The close of the pipe tells it that the leader left, and it tries at once. A candidate under a healthy leader makes no try ([ADR 0007](./docs/adr/0007-a-candidate-waits-on-pushes-from-the-leaders-pipe-not-on-a-period.md)).
81
81
  - **A hung leader.** A candidate that hears no heartbeat for the `leaseDuration` of the record sends `SIGKILL` to the process of the record, but only while it holds that process's pipe open. The kernel frees the claim and closes the pipe, and the candidate tries. The kernel refuses the kill for a process of another user: then the candidate ends nothing, and it waits for the close until its `timeout`. A reader never ends its own process, in the same way ([ADR 0006](./docs/adr/0006-a-candidate-ends-a-leader-that-is-silent-past-the-lease-duration.md)).
82
- - **A new leader that does not serve its pipe yet.** A connect that rejects with `NoServerError` of [`@zukhruf/pipes`](../pipes/README.md#errors) comes while a new leader starts, or under a published leader. On Linux it also comes when the leader closes its pipe during the connect (#5317). The candidate waits a back-off and tries again: 25 ms first, then 1.6 times longer each time, with a jitter of ±20 %, at most 1000 ms.
83
- - **An observer.** `election.observe()` returns a `LeaderObserver` for a process that does not campaign. It holds a connection to the leader's pipe and ends a silent leader as a candidate does. `observer.left` resolves `'closed'` when the leader left, `'ended'` when the observer ended it, and `'absent'` when no leader served a pipe. It rejects with any other error. Dispose it to close the connection; then `left` does not settle. Its connection and its deadline do not keep the process alive. One observer reads one term ([ADR 0009](./docs/adr/0009-a-process-that-does-not-campaign-observes-the-leader.md)).
82
+ - **A pipe that a candidate cannot connect to.** A connect that rejects with `NoServerError` of [`@zukhruf/pipes`](../pipes/README.md#errors) comes while a new leader starts, or under a published leader. On Linux it also comes when the leader closes its pipe during the connect (#5317). A connect that rejects with `EAGAIN`, on Linux when the listen queue of a hung leader's pipe is full, and one that rejects with `EACCES`, for a pipe of another user, come while a leader serves, but the candidate cannot hold a connection to its pipe (#5425). After each of them, the candidate waits a back-off and tries again: 25 ms first, then 1.6 times longer each time, with a jitter of ±20 %, at most 1000 ms.
83
+ - **An observer.** `election.observe()` returns a `LeaderObserver` for a process that does not campaign. It holds a connection to the leader's pipe and ends a silent leader as a candidate does. `observer.left` resolves `'closed'` when the leader left, `'ended'` when the observer ended it, and `'absent'` when it held no connection to a leader's pipe: no leader served one, the pipe was another user's, or its listen queue was full. It rejects with any other error. Dispose it to close the connection; then `left` does not settle. Its connection and its deadline do not keep the process alive. One observer reads one term ([ADR 0009](./docs/adr/0009-a-process-that-does-not-campaign-observes-the-leader.md)).
84
84
  - `leaseDuration` is the longest silence, in milliseconds, that a candidate or an observer accepts from the leader. It defaults to 15000, as the `LeaseDuration` of Kubernetes. A reader uses the value in the record, so the leader decides it.
85
85
  - `heartbeatInterval` is the time between two heartbeats, in milliseconds. It defaults to a third of `leaseDuration`, as etcd's client sends a keepalive every TTL / 3. The name is etcd's `heartbeat-interval`.
86
86
  - The constructor throws a `RangeError` unless `0 < heartbeatInterval < leaseDuration`.
@@ -10,9 +10,10 @@ export declare class LeaderObserver implements Disposable {
10
10
  constructor(recordPath: string, clock: Clock);
11
11
  /**
12
12
  * Resolves `'closed'` when the leader left, `'ended'` when this observer
13
- * ended a silent leader and its pipe closed, and `'absent'` when no leader
14
- * served a pipe. Rejects with any other error. Never settles after a
15
- * disposal.
13
+ * ended a silent leader and its pipe closed, and `'absent'` when it held no
14
+ * connection to a leader's pipe: no leader served one, the pipe was another
15
+ * user's, or its listen queue was full. Rejects with any other error.
16
+ * Never settles after a disposal.
16
17
  */
17
18
  get left(): Promise<Left | 'absent'>;
18
19
  /** Closes the connection and clears the deadline. */
@@ -1 +1 @@
1
- {"version":3,"file":"leader-observer.d.ts","sourceRoot":"","sources":["../../src/sqlite/leader-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAU,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,oBAAoB,CAAC;AAE3D;;;;GAIG;AACH,qBAAa,cAAe,YAAW,UAAU;;IAI/C,YAAY,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAY3C;IAED;;;;;OAKG;IACH,IAAI,IAAI,IAAI,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC,CAEnC;IAED,qDAAqD;IACrD,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAEvB;CACF"}
1
+ {"version":3,"file":"leader-observer.d.ts","sourceRoot":"","sources":["../../src/sqlite/leader-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAU,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,oBAAoB,CAAC;AAE3D;;;;GAIG;AACH,qBAAa,cAAe,YAAW,UAAU;;IAI/C,YAAY,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAY3C;IAED;;;;;;OAMG;IACH,IAAI,IAAI,IAAI,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC,CAEnC;IAED,qDAAqD;IACrD,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAEvB;CACF"}
@@ -21,9 +21,10 @@ export class LeaderObserver {
21
21
  }
22
22
  /**
23
23
  * Resolves `'closed'` when the leader left, `'ended'` when this observer
24
- * ended a silent leader and its pipe closed, and `'absent'` when no leader
25
- * served a pipe. Rejects with any other error. Never settles after a
26
- * disposal.
24
+ * ended a silent leader and its pipe closed, and `'absent'` when it held no
25
+ * connection to a leader's pipe: no leader served one, the pipe was another
26
+ * user's, or its listen queue was full. Rejects with any other error.
27
+ * Never settles after a disposal.
27
28
  */
28
29
  get left() {
29
30
  return this.#left.wait();
@@ -1 +1 @@
1
- {"version":3,"file":"leader-observer.js","sourceRoot":"","sources":["../../src/sqlite/leader-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,OAAO,cAAc;IAChB,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IAC9B,KAAK,GAAG,IAAI,MAAM,EAAmB,CAAC;IAE/C,YAAY,UAAkB,EAAE,KAAY;QAC1C,UAAU,CAAC,UAAU,EAAE;YACrB,KAAK;YACL,GAAG,EAAE,KAAK;YACV,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;SAC1B,CAAC,CAAC,IAAI,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAClC,CAAC,KAAc,EAAE,EAAE;YACjB,0CAA0C;YAC1C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO;gBAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3D,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,qDAAqD;IACrD,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
1
+ {"version":3,"file":"leader-observer.js","sourceRoot":"","sources":["../../src/sqlite/leader-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,OAAO,cAAc;IAChB,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IAC9B,KAAK,GAAG,IAAI,MAAM,EAAmB,CAAC;IAE/C,YAAY,UAAkB,EAAE,KAAY;QAC1C,UAAU,CAAC,UAAU,EAAE;YACrB,KAAK;YACL,GAAG,EAAE,KAAK;YACV,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;SAC1B,CAAC,CAAC,IAAI,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAClC,CAAC,KAAc,EAAE,EAAE;YACjB,0CAA0C;YAC1C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO;gBAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3D,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,qDAAqD;IACrD,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
@@ -10,7 +10,9 @@ export interface ReaderOptions {
10
10
  }
11
11
  /**
12
12
  * Reads the leader record, connects to its pipe once, and resolves when the
13
- * leader left. Resolves `'absent'` when no leader serves a pipe.
13
+ * leader left. Resolves `'absent'` when it holds no connection to a leader's
14
+ * pipe: no leader serves one, the pipe is another user's, or its listen queue
15
+ * is full.
14
16
  *
15
17
  * While connected, the reader keeps the deadline of the heartbeat: the
16
18
  * record's `leaseDuration` after the connect, and again after each heartbeat
@@ -1 +1 @@
1
- {"version":3,"file":"leader-reader.d.ts","sourceRoot":"","sources":["../../src/sqlite/leader-reader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAO5C,uGAAuG;AACvG,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,qFAAqF;IACrF,GAAG,EAAE,OAAO,CAAC;IACb,iHAAiH;IACjH,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC,CAe1B"}
1
+ {"version":3,"file":"leader-reader.d.ts","sourceRoot":"","sources":["../../src/sqlite/leader-reader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAO5C,uGAAuG;AACvG,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,qFAAqF;IACrF,GAAG,EAAE,OAAO,CAAC;IACb,iHAAiH;IACjH,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC,CAsB1B"}
@@ -5,7 +5,9 @@ import { unrefed } from './leader-pipe.js';
5
5
  import { readLeaderRecord } from './leader-record.js';
6
6
  /**
7
7
  * Reads the leader record, connects to its pipe once, and resolves when the
8
- * leader left. Resolves `'absent'` when no leader serves a pipe.
8
+ * leader left. Resolves `'absent'` when it holds no connection to a leader's
9
+ * pipe: no leader serves one, the pipe is another user's, or its listen queue
10
+ * is full.
9
11
  *
10
12
  * While connected, the reader keeps the deadline of the heartbeat: the
11
13
  * record's `leaseDuration` after the connect, and again after each heartbeat
@@ -25,8 +27,13 @@ export async function readLeader(recordPath, options) {
25
27
  });
26
28
  }
27
29
  catch (error) {
28
- // No server listens on the pipe of the record, or the pipe is another user's (ADR 0007).
29
- if (error instanceof NoServerError || isErrno(error, 'EACCES'))
30
+ // No server listens on the pipe of the record, the pipe is another user's
31
+ // (ADR 0007), or its listen queue is full (EAGAIN on Linux; macOS refuses
32
+ // that connect as no server, #5425): a leader serves, but no connection
33
+ // to its pipe can be held now.
34
+ if (error instanceof NoServerError ||
35
+ isErrno(error, 'EACCES') ||
36
+ isErrno(error, 'EAGAIN'))
30
37
  return 'absent';
31
38
  throw error;
32
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"leader-reader.js","sourceRoot":"","sources":["../../src/sqlite/leader-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAqB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAazE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,UAAkB,EAClB,OAAsB;IAEtB,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC1C,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;YACrD,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,yFAAyF;QACzF,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CAAC,KAAK,CAAC,CAAC;YAChB,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IACF,MAAM,GAAG,GAAG,GAAG,EAAE;QACf,IAAI,KAAK,IAAI,OAAO;YAAE,OAAO;QAC7B,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC1B,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAChD,IAAI,CAAC,GAAG;YAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC,CAAC;IACF,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,IAAI,EAAE,CAAC;QACP,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC;IACF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;QAC7C,IAAI,EAAE,CAAC;QACP,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,GAAG;QAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvB,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1B,GAAG,EAAE,CAAC;IACN,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zukhruf/election",
3
- "version": "0.8.76",
3
+ "version": "0.8.77",
4
4
  "description": "Elects a leader among candidates. Each term has a higher epoch and ends when the leader resigns or dies. Backends subclass one campaign. `SqliteElection` elects among processes of one host; candidates and observers end a leader whose pipe heartbeats stop.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,13 +40,13 @@
40
40
  "access": "public"
41
41
  },
42
42
  "dependencies": {
43
- "@zukhruf/async": "^0.8.76",
44
- "@zukhruf/fs": "^0.8.76",
45
- "@zukhruf/lease": "^0.8.76",
46
- "@zukhruf/pipes": "^0.8.76"
43
+ "@zukhruf/async": "^0.8.77",
44
+ "@zukhruf/fs": "^0.8.77",
45
+ "@zukhruf/lease": "^0.8.77",
46
+ "@zukhruf/pipes": "^0.8.77"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@sinonjs/fake-timers": "15.5.0",
50
- "@zukhruf/testing": "^0.8.76"
50
+ "@zukhruf/testing": "^0.8.77"
51
51
  }
52
52
  }