@procedures/server 0.20.0 → 0.22.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/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @procedures/server
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @procedures/peer@0.22.0
8
+ - @procedures/client@0.22.0
9
+
10
+ ## 0.21.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 4e496ba: Breaking: `server.start` waits for the readiness of the server, and a start that is not ready at the timeout gives `success: false` (CLI-9). Before, the procedure read the lockfile and `host.info` each 500 ms for 15 s, and at the timeout it gave `success: true` with the message "still loading" while the process still started. CLI-9 step 1, a PATCH before this release, marked that result as deprecated.
15
+
16
+ The new behavior:
17
+
18
+ - `server.start` reads the readiness probe of the new listener (`/_probes/readiness`, from CLI-9 step 1) until it answers 200.
19
+ - The probe has no identity: another server on the port can answer it. Thus the procedure also needs the new lockfile of the port, and `host.info` must answer its token with its peer id.
20
+ - A listener without probes (a build of `mark` before CLI-9, for example an older `mark` in `PATH`) answers 404. Then `host.info` alone tells the readiness, because the service refuses each call until its startup ends.
21
+ - The wait stops as soon as the server is ready, or as soon as its process exits. Before, it read each 500 ms and found an exit only at the next read.
22
+ - An exit before the readiness gives `success: false`, the PID, the log file and the exit code or the signal of the process. A spawn that fails (no `mark` in `PATH`) gives the same result. Before, its error event was not handled.
23
+ - At the timeout, the result is `success: false`, with the PID of the process that still starts, the port and the log file. The procedure does not stop that process.
24
+ - The new optional input `timeout` sets the limit in milliseconds (1 to 600000). The default stays 15000.
25
+
26
+ Migration:
27
+
28
+ - A script that runs `mark server start` and reads `success` now gets `false` when the server is not ready at the timeout. Give a longer `timeout` (`mark server start --timeout 60000`), or read `mark server status` later. The `pid` of the result is the process that still starts.
29
+ - The site: no change. It does not start `server.start`.
30
+ - MiniMongo: no change. Its dev host starts through `runProcedureHost()`, not through `server.start`.
31
+ - Graph: no change. Its hosts do not start `server.start`.
32
+ - jarvis: no change. It does not start `server.start`.
33
+
34
+ ### Patch Changes
35
+
36
+ - @procedures/client@0.21.0
37
+ - @procedures/peer@0.21.0
38
+
3
39
  ## 0.20.0
4
40
 
5
41
  ### Patch Changes
package/README.md CHANGED
@@ -244,14 +244,16 @@ The package has three procedures. They manage the background server of the `mark
244
244
 
245
245
  | Procedure | Function |
246
246
  |---|---|
247
- | `server.start` | Start the CLI server as a background process. It writes `~/.mark/server.log`. It waits up to 15 s for the server. |
247
+ | `server.start` | Start the CLI server as a background process, and wait for its readiness. It writes `~/.mark/server.log`. |
248
248
  | `server.stop` | Stop the CLI servers of the lockfiles, or the server of one port. A process that does not answer as the peer of its lockfile gets no signal. |
249
249
  | `server.status` | Give the state of the CLI servers. It deletes the lockfile of a server that does not answer. |
250
250
 
251
251
  - `import "@procedures/server/register"` registers them in the global registry. The package root and the `./module` entry register nothing.
252
252
  - `mark` finds the package from its `client.procedures` field: `mark server start`, `mark server stop` and `mark server status` run them.
253
253
  - The lockfiles stay in `@procedures/peer` (`@procedures/peer/lockfile`), because the peer of `mark --server` writes them.
254
- - **Deprecated (CLI-9):** at the timeout of 15 s, `server.start` gives `success: true` with the message "still loading" when 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 (`/_probes/readiness`) or `mark server status` for the state.
254
+ - `server.start` waits for the readiness of the server (CLI-9). It reads the readiness probe of the listener (`/_probes/readiness`) until it answers 200. The probe has no identity, thus `host.info` must also answer the token of the new lockfile with its peer id. A listener without probes (a build of `mark` before CLI-9) answers 404, and then `host.info` alone tells the readiness.
255
+ - The wait stops as soon as the server is ready or its process exits. `timeout` (milliseconds, default 15000) sets the limit.
256
+ - At the timeout, `server.start` gives `success: false` with the PID of the process that still starts. Before CLI-9, it gave `success: true` with the message "still loading".
255
257
 
256
258
  ---
257
259