@zukhruf/election 0.8.230 → 0.8.232
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 +18 -16
- package/dist/leader-selector.d.ts.map +1 -1
- package/dist/leader-selector.js +27 -5
- package/dist/leader-selector.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -182,14 +182,15 @@ second resigns
|
|
|
182
182
|
|
|
183
183
|
The signal of the task aborts at the dispose, at `interruptLeadership()`, and when the term is lost. Return, or reject with `signal.reason`, to give the leadership up. After each round:
|
|
184
184
|
|
|
185
|
-
| The round ends because | With `autoRequeue`
|
|
186
|
-
| ---------------------------------------------------------------- |
|
|
187
|
-
| The dispose aborted the selector, in the campaign or in the task | The selector ends, after it resigned the term. `ended` resolves.
|
|
188
|
-
| The term was lost, or `interruptLeadership()` aborted the task | The next round starts at once, with no wait.
|
|
189
|
-
| The task resolved | The next round starts at once.
|
|
190
|
-
| The task rejected | The selector ends, after it resigned the term. `ended` and the dispose reject with the failure.
|
|
191
|
-
| The resign failed after the task resolved | The selector ends with that failure. `ended` and the dispose reject with it.
|
|
192
|
-
| The
|
|
185
|
+
| The round ends because | With `autoRequeue` | Without `autoRequeue` |
|
|
186
|
+
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------- |
|
|
187
|
+
| The dispose aborted the selector, in the campaign or in the task | The selector ends, after it resigned the term. `ended` resolves. | The same. |
|
|
188
|
+
| The term was lost, or `interruptLeadership()` aborted the task | The next round starts at once, with no wait. | The selector waits for `requeue()`. |
|
|
189
|
+
| The task resolved | The next round starts at once. | The selector waits for `requeue()`. |
|
|
190
|
+
| The task rejected | The selector ends, after it resigned the term. `ended` and the dispose reject with the failure. | The same. |
|
|
191
|
+
| The resign failed after the task resolved | The selector ends with that failure. `ended` and the dispose reject with it. | The same. |
|
|
192
|
+
| The task rejected, and the resign failed too | The selector ends with a `SuppressedError`: its `error` is the failure to resign, its `suppressed` the failure of the task. When the resign failed with the task's own error, the selector ends with that error ([ADR 0012](./docs/adr/0012-a-task-failure-and-a-resign-failure-that-are-one-error-end-the-leader-selector-with-that-error.md)). | The same. |
|
|
193
|
+
| The campaign failed | A `LeaderSelectorWarning` (see [Errors](#errors)), then a wait of `backoff.duration(retries)` on `clock`, then the next campaign. `retries` counts the failed campaigns since the last term. | The selector ends. `ended` and the dispose reject with the failure. |
|
|
193
194
|
|
|
194
195
|
- **Each backend.** `start` takes a `LeaderElection`, so the selector leads over each backend: `SqliteElection` among the processes of one host, or a backend of your own ([Write a backend](#write-a-backend)). The task gets the `Term`, with its epoch.
|
|
195
196
|
- **A task that ends after a loss has a loss.** When the term is lost, a task that resolves or rejects after it ends the round as a loss, not as a failure.
|
|
@@ -298,14 +299,14 @@ The socket lock store of `@zukhruf/mutex` uses `SqliteElection`, with the claim
|
|
|
298
299
|
|
|
299
300
|
## Errors
|
|
300
301
|
|
|
301
|
-
| Error | When
|
|
302
|
-
| ------------------------------ |
|
|
303
|
-
| `NetworkDirectoryError` | The directory of a `SqliteElection` is on a network file system. It is the class of `@zukhruf/fs`.
|
|
304
|
-
| `LeaseLostError` | The reason of `term.signal` when the backend took the claim away. Its `subject` is `'leadership'`, and its `cause` is the backend's reason. It is the class of `@zukhruf/lease`, and this package exports it too.
|
|
305
|
-
| `signal.reason` | A campaign rejects with it when its signal aborts.
|
|
306
|
-
| `SuppressedError` | A campaign or a resign rejects with it when a step failed and giving the claim up or freeing it failed too. Its `suppressed` is the step's error, and its `error` is the failure to free.
|
|
307
|
-
| `RangeError` | A campaign of a `SqliteElection` rejects with it when the next epoch would be 2^31 or more. The message names `epochFile`.
|
|
308
|
-
| The failure of a leader's task | `ended` and the dispose of a `LeaderSelector` reject with the error of a task that failed, of a resign that failed, and, without `autoRequeue`, of a failed campaign. `requeue()` throws an `Error` after the dispose, and after a failure ended the selector.
|
|
302
|
+
| Error | When |
|
|
303
|
+
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
304
|
+
| `NetworkDirectoryError` | The directory of a `SqliteElection` is on a network file system. It is the class of `@zukhruf/fs`. |
|
|
305
|
+
| `LeaseLostError` | The reason of `term.signal` when the backend took the claim away. Its `subject` is `'leadership'`, and its `cause` is the backend's reason. It is the class of `@zukhruf/lease`, and this package exports it too. |
|
|
306
|
+
| `signal.reason` | A campaign rejects with it when its signal aborts. |
|
|
307
|
+
| `SuppressedError` | A campaign or a resign rejects with it when a step failed and giving the claim up or freeing it failed too. Its `suppressed` is the step's error, and its `error` is the failure to free. A `LeaderSelector` ends with it when its task failed and the resign failed with another error. |
|
|
308
|
+
| `RangeError` | A campaign of a `SqliteElection` rejects with it when the next epoch would be 2^31 or more. The message names `epochFile`. |
|
|
309
|
+
| The failure of a leader's task | `ended` and the dispose of a `LeaderSelector` reject with the error of a task that failed, of a resign that failed, and, without `autoRequeue`, of a failed campaign. `requeue()` throws an `Error` after the dispose, and after a failure ended the selector. |
|
|
309
310
|
|
|
310
311
|
A failure that no caller waits for is a process warning, in the shape of [root ADR 0010](../../docs/adr/0010-a-package-warning-names-its-type-code-and-subject-and-keeps-the-failure-as-its-cause.md). A `'warning'` listener reads its type as `name`, its `code`, and its subject in `detail`, one `<term>: <value>` line each. Its `cause` is the failure, and its message ends with the failure's message. `--disable-warning=<code or type>` stops the print. `TermWarning` and `LeaderSelectorWarning` are classes that the package exports, so a listener can test `warning instanceof` the class ([root ADR 0011](../../docs/adr/0011-a-package-warning-is-an-instance-of-its-own-class-which-the-package-exports.md)). With two installed copies of the package, `instanceof` fails across the copies, so compare `code`.
|
|
311
312
|
|
|
@@ -452,6 +453,7 @@ export { LeaseLostError } from '@zukhruf/lease';
|
|
|
452
453
|
- [ADR 0009: A process that does not campaign observes the leader](./docs/adr/0009-a-process-that-does-not-campaign-observes-the-leader.md) (proposed)
|
|
453
454
|
- [ADR 0010: An election has a name, and the name of a SQLite election is the path of its claim file](./docs/adr/0010-an-election-has-a-name-and-the-name-of-a-sqlite-election-is-the-path-of-its-claim-file.md)
|
|
454
455
|
- [ADR 0011: A leader selector runs a task each time it wins a term of a leader election, over a `LeaderElection` only](./docs/adr/0011-a-leader-selector-runs-a-task-each-time-it-wins-a-term-of-a-leader-election.md)
|
|
456
|
+
- [ADR 0012: A task failure and a resign failure that are one error end the leader selector with that error](./docs/adr/0012-a-task-failure-and-a-resign-failure-that-are-one-error-end-the-leader-selector-with-that-error.md)
|
|
455
457
|
- [Code copied into this package](./docs/copied-code.md)
|
|
456
458
|
|
|
457
459
|
## Development
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leader-selector.d.ts","sourceRoot":"","sources":["../src/leader-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIX,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,qBAAqB;IACpC,0EAA0E;IAC1E,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,GAAG,SAAS,CAAC;CAC9D;AAED;;;;;;GAMG;AACH,qBAAa,cAAe,YAAW,eAAe;;IAQpD,OAAO,eASN;IAED,yFAAyF;IACzF,MAAM,CAAC,KAAK,CACV,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,EACjC,QAAQ,EAAE,sBAAsB,EAChC,EAAE,WAAW,EAAE,GAAE,qBAA0B,GAC1C,cAAc,CAQh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I;IACrI,OAAO,IAAI,OAAO,CASjB;IAED,4FAA4F;IAC5F,mBAAmB,IAAI,IAAI,CAE1B;IAED,qFAAqF;IACrF,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAGrC;CAgFF"}
|
package/dist/leader-selector.js
CHANGED
|
@@ -88,12 +88,34 @@ export class LeaderSelector {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
* Runs the task while the term lasts, and resigns the term after it.
|
|
92
|
-
*
|
|
93
|
-
*
|
|
91
|
+
* Runs the task while the term lasts, and resigns the term after it. Only
|
|
92
|
+
* a failure of the task, or of the resign, rejects. When both fail, it
|
|
93
|
+
* rejects with a `SuppressedError` whose `error` is the failure to resign
|
|
94
|
+
* and whose `suppressed` is the task's, as `await using` does; when the
|
|
95
|
+
* resign fails with the task's own failure, it rejects with that failure.
|
|
94
96
|
*/
|
|
95
|
-
async #lead(
|
|
96
|
-
|
|
97
|
+
async #lead(term, stop) {
|
|
98
|
+
try {
|
|
99
|
+
await this.#task(term, stop);
|
|
100
|
+
}
|
|
101
|
+
catch (failure) {
|
|
102
|
+
await term.resign().catch((resignFailure) => {
|
|
103
|
+
// `await using` would suppress the one failure under itself.
|
|
104
|
+
if (resignFailure === failure) {
|
|
105
|
+
throw failure;
|
|
106
|
+
}
|
|
107
|
+
throw new SuppressedError(resignFailure, failure, 'The task failed, and its term failed to resign.');
|
|
108
|
+
});
|
|
109
|
+
throw failure;
|
|
110
|
+
}
|
|
111
|
+
await term.resign();
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Runs the task. Its signal aborts at the dispose, at
|
|
115
|
+
* `interruptLeadership()` and at a loss. Rejects only with a failure of
|
|
116
|
+
* the task.
|
|
117
|
+
*/
|
|
118
|
+
async #task(term, stop) {
|
|
97
119
|
const interrupt = new AbortController();
|
|
98
120
|
const signal = AbortSignal.any([stop, interrupt.signal, term.signal]);
|
|
99
121
|
this.#state = new Leading(interrupt);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leader-selector.js","sourceRoot":"","sources":["../src/leader-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGjB,KAAK,EACL,KAAK,EACL,YAAY,GACb,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAarE;;;;;;GAMG;AACH,MAAM,OAAO,cAAc;IAChB,SAAS,CAA0B;IACnC,SAAS,CAAyB;IAClC,QAAQ,CAAU;IAClB,SAAS,GAAG,IAAI,eAAe,EAAE,CAAC;IAC3C,MAAM,GAAoC,MAAM,CAAC;IACxC,OAAO,CAAoB;IAEpC,YACE,QAAiC,EACjC,QAAgC,EAChC,OAAgB;QAEhB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,yFAAyF;IACzF,MAAM,CAAC,KAAK,CACV,QAAiC,EACjC,QAAgC,EAChC,EAAE,WAAW,EAAE,GAA0B,EAAE;QAE3C,OAAO,IAAI,cAAc,CACvB,QAAQ,EACR,QAAQ,EACR,WAAW,KAAK,SAAS;YACvB,CAAC,CAAC,IAAI,aAAa,EAAE;YACrB,CAAC,CAAC,IAAI,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,CAChD,CAAC;IACJ,CAAC;IAED,wCAAwC;IACxC,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,MAAM,YAAY,OAAO,CAAC;IACxC,CAAC;IAED,qFAAqF;IACrF,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,OAAO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I;IACC,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;CACjC;AAED,oFAAoF;AACpF,MAAM,KAAK;CAAG;AAEd,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/election",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.232",
|
|
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,15 +40,15 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@zukhruf/async": "^0.8.
|
|
44
|
-
"@zukhruf/fs": "^0.8.
|
|
45
|
-
"@zukhruf/lease": "^0.8.
|
|
46
|
-
"@zukhruf/pipes": "^0.8.
|
|
43
|
+
"@zukhruf/async": "^0.8.232",
|
|
44
|
+
"@zukhruf/fs": "^0.8.232",
|
|
45
|
+
"@zukhruf/lease": "^0.8.232",
|
|
46
|
+
"@zukhruf/pipes": "^0.8.232"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@sinonjs/fake-timers": "15.5.0",
|
|
50
|
-
"@zukhruf/parameterized-test": "^0.8.
|
|
51
|
-
"@zukhruf/process": "^0.8.
|
|
52
|
-
"@zukhruf/testing": "^0.8.
|
|
50
|
+
"@zukhruf/parameterized-test": "^0.8.232",
|
|
51
|
+
"@zukhruf/process": "^0.8.232",
|
|
52
|
+
"@zukhruf/testing": "^0.8.232"
|
|
53
53
|
}
|
|
54
54
|
}
|