@mark1russell7/harness 0.11.13 → 0.11.14

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
@@ -335,6 +335,7 @@ The distribution test needs a simulator, which does not exist at this time.
335
335
  - A replica set cell opens a replica set environment (`openReplicaSetLab`), and each run is `replicaSetOnce`. A run with a hold continues to the end of the hold, thus its record shows what the set did in all of it.
336
336
  - A driver cell (`prediction.driver`) waits for the end of its band and of each later band. A silent driver cell waits for its window.
337
337
  - **The observer.** A cell observes the client, the server, or a socket of a proxy toward one side (`observer`). A cell on the server side measures the socket of the target for the connection of the client. The run waits for the error of that socket. `freeze-process` freezes the peer of the observer: the target for the client, the client for the server.
338
+ - A socket of a proxy toward the target is the socket that carries the request of the run. It is the first socket of the hop that sends data to the target after the request. A pooler can reuse a server connection from the warm-up of the environment. Then the first socket that it opens in the run is not the socket of the request. A run without such a socket uses the first socket that the run opens.
338
339
  - A cell on the server side sets the sysctls of the target through `targetSysctls`, with a privileged sidecar in the namespace of the target. That sidecar starts only when a cell asks for it.
339
340
  - Its in-flight data is the reply of the server. Thus the client sends `probe.request` first, for example a BLPOP with a timeout, and the fault occurs while the server holds it.
340
341
  - **The pause before the fault.** In every other run, the fault comes 250 ms after the client's first reply (`QUIET_MS`). That is more than Linux's longest delayed ACK, 200 ms. A fault that comes earlier meets the client's delayed ACK of the reply, not the request or the idle time that the cell measures. On a fast host the fault came 35 ms after the reply, and the ACK met a reset first.
package/build/index.d.ts CHANGED
@@ -417,7 +417,8 @@ interface SocketPlace {
417
417
  * This function finds the socket of the observer of a cell in a run:
418
418
  * - the client socket, by the address that it connected from, in its namespace.
419
419
  * - the socket of the target for the same connection, in its namespace.
420
- * - a socket of a proxy of the topology, toward the client or toward the target.
420
+ * - a socket of a proxy of the topology, toward the client or toward the target. Toward the target,
421
+ * it is the socket that carries the request, else the first socket that the run opens.
421
422
  */
422
423
  export declare const socketOf: (cell: Cell, run: Run) => SocketPlace | undefined;
423
424
  /** This function gives what reordering did in a run, from the records of the receiver and of the sender. */
package/build/index.js CHANGED
@@ -1421,6 +1421,21 @@ const opened = (run, netns, peer) => {
1421
1421
  cookie: record.cookie
1422
1422
  };
1423
1423
  };
1424
+ /**
1425
+ * This function finds the socket of a hop that carries the request of a run toward the target. It is
1426
+ * the first socket of the hop that sends data to the target after the send of the request. A pooler can
1427
+ * reuse a server that it opened before the run, in the warm-up of the environment. Then the first
1428
+ * socket that it opens in the run is another one (run 39160356281).
1429
+ */
1430
+ const carried = (run, netns, target) => {
1431
+ const request = run.events.filter((event) => event.ev === "sent")[1];
1432
+ if (request === void 0) return void 0;
1433
+ const record = run.kernel.find((each) => each.netns === netns && each.ev === "tx" && each.dst === target && (each.seg?.len.value ?? 0) > 0 && each.mono >= request.t);
1434
+ return record?.cookie === void 0 ? void 0 : {
1435
+ netns,
1436
+ cookie: record.cookie
1437
+ };
1438
+ };
1424
1439
  /** This function finds the socket of the target for the connection of a run. In a topology, its peer is the last hop. */
1425
1440
  const targetSocket = (run, local) => {
1426
1441
  if (run.topology === void 0) {
@@ -1437,7 +1452,8 @@ const targetSocket = (run, local) => {
1437
1452
  * This function finds the socket of the observer of a cell in a run:
1438
1453
  * - the client socket, by the address that it connected from, in its namespace.
1439
1454
  * - the socket of the target for the same connection, in its namespace.
1440
- * - a socket of a proxy of the topology, toward the client or toward the target.
1455
+ * - a socket of a proxy of the topology, toward the client or toward the target. Toward the target,
1456
+ * it is the socket that carries the request, else the first socket that the run opens.
1441
1457
  */
1442
1458
  const socketOf = (cell, run) => {
1443
1459
  const local = run.events.find((event) => event.ev === "connected")?.["local"];
@@ -1452,7 +1468,7 @@ const socketOf = (cell, run) => {
1452
1468
  if (observer === "server") return targetSocket(run, local);
1453
1469
  const hop = run.topology?.hops[observer.hop];
1454
1470
  if (hop === void 0) return void 0;
1455
- return observer.toward === "client" ? opened(run, hop.netns, (dst) => ipOf(dst) === hop.client) : opened(run, hop.netns, (dst) => dst === hop.target);
1471
+ return observer.toward === "client" ? opened(run, hop.netns, (dst) => ipOf(dst) === hop.client) : carried(run, hop.netns, hop.target) ?? opened(run, hop.netns, (dst) => dst === hop.target);
1456
1472
  };
1457
1473
  /**
1458
1474
  * This function finds the socket of the peer of the observer: its close is the reference of a FIN.