@procedures/peer 0.17.1 → 0.17.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @procedures/peer
2
2
 
3
+ ## 0.17.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 636f098: New: the procedures host answers the health probes of its service (CLI-9, decision D5). The probes come from `probeHandler()` and `probeServer()` of `@mark1russell7/service/http`. This change is additive, thus it is a PATCH of the client group (decision D13).
8
+
9
+ - Each listener of `createProcedureHost()` answers `GET /_probes/startup`, `/_probes/readiness` and `/_probes/liveness` from the health of the service. The answer is 200, or 503 with `Retry-After` during the startup and the shutdown. `/_probes/readiness/<controller>` gives the readiness of one controller.
10
+ - The probes need no token and pass no browser check. They give only the status. They mount before the faces, thus a probe path never reaches a procedure. Each other path goes to the faces with the token and the browser checks, as before.
11
+ - A listener does not answer the report of the service (`/_probes/report`), because it names the checks and the dependencies. The procedure `host.health` gives the details with the token.
12
+ - The probes of a listener stop when the intake stops. Thus the listener still closes at the stop of the intake, and a new connection is refused, as before. `probes: { until: "close transports" }` keeps the listener open through the drain: the probes answer 503, and each other request gets 503 with `Retry-After`.
13
+ - The new option `probes` of `createProcedureHost()`: `{ prefix, until }` changes the prefix and the last stage, and `false` turns the probes off. `HOST_PROBE_PREFIX` is `/_probes`. `host.info.probes()` gives the base URL of the probes on each listener.
14
+ - The new option `probes` of `runProcedureHost()`: `{ port, host, prefix, retryAfter }` declares a probe server on a port of its own (`svc.healthServer(probeServer(...))`). It starts first and closes last, thus its probes answer through the whole drain. It also answers `/report`. The listeners of the host then answer no probes, unless the host options give `probes`. `probes()` of the result gives the base URL of each place that answers the probes.
15
+ - The new flag `--probe-port <port>` of `procedure-server`, `mark serve` and `mark --server` gives the probe server, on the address of `--host`. `mark` refuses it without `--server` before a command, as it refuses `--port`. The startup prints the URL of the probes.
16
+
17
+ Deprecated: at the timeout of 15 s, `server.start` gives `success: true` with the message "still loading" while the process still starts. From the next MINOR of the client group, a start that is not ready at the timeout gives `success: false`, with the PID of the process that still starts. Read the readiness probe or `mark server status` for the state.
18
+
19
+ The site, MiniMongo, Graph and jarvis: no change. A host with a listener now also answers the paths under `/_probes`. Before, these paths got 404.
20
+ - @procedures/client@0.17.3
21
+
22
+ ## 0.17.2
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [8b7e20c]
27
+ - @procedures/client@0.17.2
28
+
3
29
  ## 0.17.1
4
30
 
5
31
  ### Patch Changes
package/README.md CHANGED
@@ -146,6 +146,13 @@ await svc.run();
146
146
  - **The expose rule.** The rule of the policy applies to each procedure that the host serves, also to the collection procedures (CLI-47). A host with an expose rule must list the collection procedures that it serves, for example `collections.notes.*`. An `exclude` hides one of them, for example `collections.notes.clear`. The option `expose` of the host wins over the rule of the policy, for the server and for each face.
147
147
  - **Always on.** `host.health`, `host.info`, `host.metrics` and `events.subscribe` stay on, whatever the expose rule says. The host pins them with `registerProcedures(procedures, { alwaysOn: true })`. The topic rule is the expose rule of `events.subscribe`.
148
148
  - **No `/health` route.** The probes come from the runner (`probeHandler` or `probeServer`). A client checks a lockfile with `host.info` and the token of the lockfile.
149
+ - **The probes.** Each listener of the host answers the probes of the service under `/_probes` (CLI-9, decision D5). The handler is `probeHandler()` of `@mark1russell7/service/http`, and it mounts before the faces.
150
+ - `GET /_probes/startup`, `/_probes/readiness` and `/_probes/liveness` answer 200, or 503 with `Retry-After`. `/_probes/readiness/<controller>` gives the readiness of one controller.
151
+ - The probes answer each caller without the token and the browser checks. They give only the status. Each other path goes to the faces, with the token and the browser checks as before.
152
+ - A listener does not answer the report (`/_probes/report`), because it names the checks and the dependencies. `host.health` gives the details with the token.
153
+ - The probes stop when the intake stops. Then the listener closes, as without the probes, and a new connection is refused. `probes: { until: "close transports" }` keeps the listener open through the drain: the probes answer 503, and each other request gets 503 with `Retry-After`.
154
+ - `probes: { prefix }` changes the prefix. `probes: false` turns the probes off, for example when the process has a probe server on a port of its own (`probeServer()`, or the option `probes` of `runProcedureHost()`).
155
+ - `host.info.probes()` gives the base URL of the probes on each listener. Without `listen`, the app mounts `probeHandler()` on its own listener.
149
156
 
150
157
  ### Creating a Server Peer
151
158