@mark1russell7/harness 0.16.1 → 0.16.2
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 +24 -1
- package/build/{cell-CHFQ55Ks.d.ts → cell-CXxqXp1q.d.ts} +7 -0
- package/build/image-D509StXX.js.map +1 -1
- package/build/index.d.ts +28 -5
- package/build/index.js +47 -24
- package/build/index.js.map +1 -1
- package/build/schema.d.ts +1 -1
- package/image/native/src/bin/inject.rs +153 -23
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -62,6 +62,8 @@ A topology (`Topology`) is the chain of hops from the client to the target, as d
|
|
|
62
62
|
|
|
63
63
|
The element before a router reaches the networks after the router through it. Its privileged sidecar, or the router itself, adds each route. A router translates the address of the side of the client, thus the target and each later hop see the router as the peer.
|
|
64
64
|
|
|
65
|
+
`Lab.topology` (`RunTopology`) gives each hop its namespace and its peer on each side. From 0.16.2, it also gives the own address of the hop on each side (`address`). The address of a router on the side of the client is the gateway of the element before it. A record from before 0.16.2 has no `address`.
|
|
66
|
+
|
|
65
67
|
A lookup treats an expired conntrack entry as gone, thus the router forgets a flow at its timeout, to the jiffy. The DESTROY event of the entry waits for the garbage collector or a list of the table. Thus `ctwatch.py` in the router lists the table each `pump` (`PUMP`, 0.1 s by default). A DESTROY then follows an expiry within the pump and two lists of the table.
|
|
66
68
|
|
|
67
69
|
`LISTING` (20 ms) is the longest list of the table that a prediction assumes. A longer list writes a `pump-slow` line, and a run with one near a detection by a timer of conntrack is void. `PUMP_SLACK` (5 ms) is how late the pump can be after its interval and two lists. Its sleep can end late, and the read of the event takes time. Thus a DESTROY follows an expiry within the interval of the pump, two lists and that slack.
|
|
@@ -212,7 +214,7 @@ From 0.11.20, the harness builds each image with the CLI of Docker (`docker buil
|
|
|
212
214
|
- `client`, the TCP client of a cell. Rust's `std::net` sets no socket option by itself, thus the measurement gets the timers of the namespace. The client also samples `TCP_INFO` each 2 ms, a second vantage on its socket. It waits in `poll()`, which does not lock the socket. A keepalive timer that finds its socket held tries again HZ/20 later.
|
|
213
215
|
- In a stream, a reply of the `client` is whole at its CRLF, or after the length of a bulk string. The client then writes a `replied` line.
|
|
214
216
|
- `load`, the open-loop driver of an HTTP/1.1 server (SYS-93). Its plan (`systems-load/1`) is a list of streams, each with a key, a schedule (`rigor-schedule/1`) and its requests. Each stream has its own connection, thus a slow reply delays only its own stream. A send does not wait for a reply. A response is whole after its `Content-Length` or its last chunk. The `sent` and `replied` lines name the stream (`k`) and the arrival (`i`), and a `replied` line names the status.
|
|
215
|
-
- `inject`, which applies a fault in one `iptables-restore` commit, with monotonic stamps around the commit. Thus the start of a fault is known in the VM. A `docker exec` from Windows comes 190 ms late at the median. With `--via DEV`, the rules go in the FORWARD chain, on the device toward one side.
|
|
217
|
+
- `inject`, which applies a fault in one `iptables-restore` commit, with monotonic stamps around the commit. Thus the start of a fault is known in the VM. A `docker exec` from Windows comes 190 ms late at the median. With `--via DEV`, the rules go in the FORWARD chain, on the device toward one side. `--protocol` and `--handshake pass` change the match of a rule, and `inject silence` drops each packet of its namespace.
|
|
216
218
|
- `inject` also sends a signal to a process by its name (`signal`), and one command to a server of the Redis protocol (`resp`). Stamps bracket each.
|
|
217
219
|
- **The Node client image** (`image/node`) is a driver client: ioredis 6.0.0 on Node 24.21.0. The digest of the image and an npm lockfile pin them. `client-ioredis.mjs` prints the lines of the TCP client on the same clock, and it adds the status changes of ioredis as `status` lines. The same image holds the client of a group in Sentinel mode (`client-sentinel.mjs`) and the observer of its Sentinels (`observer.mjs`).
|
|
218
220
|
- **The Go HTTP image** (`image/go-http`) is the `http.Transport` of Go 1.27.2 at its defaults (`client-go`). The program uses the standard library only, thus the digest of the Go builder pins all of its code. The build does `gofmt` and `go vet` first. A wrapper on each connection writes what the read loop of the transport reads. The trace of the transport writes each try of a request.
|
|
@@ -312,6 +314,25 @@ A length match and netem act on GSO super-packets of up to 64 KB, not on segment
|
|
|
312
314
|
|
|
313
315
|
Each run starts from kernels that keep nothing from the run before it (`lab.forget()`). When a connection closes, each kernel keeps TCP metrics for the address of its peer. These metrics set the first round trip of the next connection, and thus its RTO. The harness removes the `tcp_metrics` of the two namespaces before each run.
|
|
314
316
|
|
|
317
|
+
### The faults of a lab
|
|
318
|
+
|
|
319
|
+
A cell applies its fault with `Lab.fault` and removes it with `Lab.lift`. A program that drives a lab itself can also use them. The fault (`NetworkFault`) acts at a place (`FaultPlace`): the target, the client, or a hop toward one side. Its options (`FaultOptions`) are data. Each default keeps the rules from before its option:
|
|
320
|
+
|
|
321
|
+
| Option | Fault | Rule | Default |
|
|
322
|
+
| --- | --- | --- | --- |
|
|
323
|
+
| `direction`: `in`, `out` | `blackhole`, `reject` | `in` faces what comes from the peer, `out` what goes to it. At a router, `out` is `-o DEV -d PEER`. | both for a black hole, `in` for a reject |
|
|
324
|
+
| `protocol`: `tcp`, `udp`, `icmp`, `all` | `blackhole`, `reject` | `-p` and the protocol, or no match for `all` | `all` for a black hole, `tcp` for a reject |
|
|
325
|
+
| `code`: `host`, `net`, `port`, `admin` | `reject` | the ICMP unreachable of the answer | none: a reject needs a code |
|
|
326
|
+
| `above` | `mtu` | the longest segment that passes, in bytes | none: an MTU drop needs a length |
|
|
327
|
+
| `handshake`: `pass` | `rst` | `! --syn`: each SYN passes, and the next segment gets the reset | the SYN also gets the reset |
|
|
328
|
+
| `peers` | each fault except `silence` | the addresses that the rules face, in one commit | the peer of the place |
|
|
329
|
+
|
|
330
|
+
The injector refuses `protocol` on a fault other than a black hole or a reject. It refuses `handshake` on a fault other than a reset.
|
|
331
|
+
|
|
332
|
+
- **A silence** (`silence`) at a hop drops each packet of the namespace of the hop, in INPUT, OUTPUT and FORWARD, in one commit. The links stay up and ARP continues. Thus a connect through a silent router times out, and the router sends no answer. A silence names no peer and takes no option. It acts only at a hop, and the side of the hop has no effect.
|
|
333
|
+
- **A host that is down behind a router** is a reject at the router toward the target, with `direction: "out"` and `protocol: "all"`. The router answers each packet that it forwards to the host with the ICMP unreachable of `code`.
|
|
334
|
+
- **A reset after the handshake** is a reset with `handshake: "pass"`. The connect succeeds, and the first segment after it gets the reset. Thus a TLS client sees `ECONNRESET` in its handshake.
|
|
335
|
+
|
|
315
336
|
## The measurement
|
|
316
337
|
|
|
317
338
|
`measure(cell, run)` (`observe.ts`) reads a run from the records of the kernel:
|
|
@@ -484,6 +505,8 @@ The tests of `image.ts` plan the build of each image that the harness ships, and
|
|
|
484
505
|
|
|
485
506
|
The tests of `application.ts` measure a heartbeat of a program from test lines and records. They find the first ping without an answer, the drop, the waits of the reconnect and the call in flight. They also test a report of the kernel before the drop, a VM that stopped, the heartbeat of a server, and an idle stall.
|
|
486
507
|
|
|
508
|
+
The tests of `inject.test.ts` examine the arguments that a lab gives to the injector for each fault and its options. The unit tests of `inject.rs` examine its rules. The `native` job of CI starts them with `cargo test`.
|
|
509
|
+
|
|
487
510
|
The tests of `delivery.ts` read a stream from test lines of the two programs. They count the lost events, the extra copies and the unknown events, and they test each finding of the law.
|
|
488
511
|
|
|
489
512
|
The cells themselves need Docker and privileged containers. CI does not start them. `HARNESS_LAB=1` starts the lab tests on Docker. They start a client image and an agent, and they put a reset and netem at a router. They also fail a group of Valkey 9.1 over with a planned failover.
|
|
@@ -1737,6 +1737,8 @@ interface DrillRoom {
|
|
|
1737
1737
|
* the last hop.
|
|
1738
1738
|
* - `hops` are the network namespaces of the hops, by their names, with the address of the peer of
|
|
1739
1739
|
* each hop on each side.
|
|
1740
|
+
* - `address` of a hop is its own address on the network of each side. The address of a router on
|
|
1741
|
+
* the side of the client is the gateway of the element before it.
|
|
1740
1742
|
*/
|
|
1741
1743
|
interface RunTopology {
|
|
1742
1744
|
readonly targetPeer: string;
|
|
@@ -1744,6 +1746,11 @@ interface RunTopology {
|
|
|
1744
1746
|
readonly netns: number;
|
|
1745
1747
|
readonly client: string;
|
|
1746
1748
|
readonly target: string;
|
|
1749
|
+
/** This record is the address of the hop on each side. A lab gives it from 0.16.2. A record from before has none. */
|
|
1750
|
+
readonly address?: {
|
|
1751
|
+
readonly client: string;
|
|
1752
|
+
readonly target: string;
|
|
1753
|
+
};
|
|
1747
1754
|
}>>;
|
|
1748
1755
|
}
|
|
1749
1756
|
export { Prediction as $, HostSysctl as A, Stage as At, LoadPlan as B, GroupPrediction as C, RunRoute as Ct, HopPlace as D, SentinelStage as Dt, HopEvent as E, SentinelEvent as Et, KafkaPause as F, Toxic as Ft, MiddleboxForm as G, LoadStream as H, KernelRecord as I, WsProbe as It, Pair as J, Observer as K, LineCount as L, environmentProblems as Lt, ImageSource as M, Subject as Mt, Jitter as N, Target as Nt, HopSignal as O, Shipped as Ot, Kafka as P, Topology as Pt, PortsPrediction as Q, LineMatch as R, isHopPlace as Rt, GroupPlace as S, RunPause as St, Hop as T, RunTopology as Tt, MiddleboxEvent as U, LoadPrediction as V, MiddleboxExpectation as W, PausePrediction as X, PauseBand as Y, PinnedImage as Z, Fabric as _, RunBackup as _t, ClientCapability as a, QueueEnd as at, FaultPlace as b, RunGroup as bt, ClusterClientAt as c, Recovers as ct, CountBand as d, ReplicaSetStage as dt, ProbeEvent as et, DeliveryPrediction as f, Replies as ft, DriverStep as g, Run as gt, DriverBand as h, RttRange as ht, Client as i, QueueConnection as it, HttpProbe as j, StageBand as jt, HopWrite as k, ShippedImage as kt, ClusterStage as l, Reference as lt, DrillRoom as m, RouterHop as mt, CLIENT_CAPABILITIES as n, ProxyTime as nt, ClientImage as o, QueuePrediction as ot, Drill as p, RequestPrediction as pt, Outcomes as q, Cell as r, QueueBand as rt, Cluster as s, Reconnects as st, BuildImage as t, ProxyHop as tt, ConntrackPrediction as u, ReplicaSet as ut, FabricManifest as v, RunDrill as vt, GroupRole as w, RunStream as wt, Group as x, RunPart as xt, Fault as y, RunFabric as yt, LoadBand as z, latestEndOf as zt };
|