@mark1russell7/machines 0.3.18 → 0.3.20
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 +3 -1
- package/build/index.d.ts +46 -0
- package/build/index.js +794 -188
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { machineSchema } from "@mark1russell7/algebra";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/grpc/grpc-go-server.ts
|
|
4
|
-
const AT$
|
|
4
|
+
const AT$13 = "grpc-go v1.84.0";
|
|
5
5
|
const GO = "go1.27.2 src/net";
|
|
6
6
|
const ETCD = "etcd v3.6.15";
|
|
7
7
|
/** These are the facts of the transport of grpc-go, for each server on it. */
|
|
8
8
|
const TRANSPORT = [
|
|
9
9
|
{
|
|
10
|
-
ref: `${AT$
|
|
10
|
+
ref: `${AT$13} internal/transport/defaults.go:31-40 the server keepalive: Time 2 h, Timeout 20 s. MinTime of the policy 5 min. MaxConnectionIdle, Age and AgeGrace infinite`,
|
|
11
11
|
rung: "implemented"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
ref: `${AT$
|
|
14
|
+
ref: `${AT$13} internal/transport/http2_server.go:226-253 the defaults of the parameters, a jitter of 10 % on MaxConnectionAge, and TCP_USER_TIMEOUT = Timeout when Time is not infinite`,
|
|
15
15
|
rung: "implemented"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
ref: `${AT$
|
|
18
|
+
ref: `${AT$13} internal/syscall/syscall_linux.go:71-90 SetTCPUserTimeout acts only on a *net.TCPConn. On any other net.Conn it does nothing`,
|
|
19
19
|
rung: "implemented"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
ref: `${AT$
|
|
22
|
+
ref: `${AT$13} internal/transport/http2_server.go:1197-1286 keepalive(): a PING after Time with no read, and Close when no read comes for Timeout after it. MaxConnectionIdle and MaxConnectionAge drain with GOAWAY, and AgeGrace closes`,
|
|
23
23
|
rung: "implemented"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
ref: `${AT$
|
|
26
|
+
ref: `${AT$13} internal/transport/http2_server.go:881-933 handlePing: a PING less than MinTime after the last one is a strike, and with no stream open and PermitWithoutStream false, less than 2 h. The third strike sends GOAWAY ENHANCE_YOUR_CALM too_many_pings and closes the connection`,
|
|
27
27
|
rung: "implemented"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
ref: `${AT$
|
|
30
|
+
ref: `${AT$13} internal/transport/http2_server.go:279-281, :1064, :1132, :1176 each write of headers, a status or data by the server clears the strikes`,
|
|
31
31
|
rung: "implemented"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
ref: `${AT$
|
|
34
|
+
ref: `${AT$13} internal/transport/http2_server.go:1291-1310 Close closes the net.Conn: a FIN, or a reset when bytes are unread`,
|
|
35
35
|
rung: "implemented"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
ref: `${AT$
|
|
38
|
+
ref: `${AT$13} internal/transport/http2_server.go:536-537, :603-615 a call with the header grpc-timeout gets a timer of that timeout from the read of its headers. Its end closes the stream with RST_STREAM CANCEL, and the context of the handler ends`,
|
|
39
39
|
rung: "implemented"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
ref: `${AT$
|
|
42
|
+
ref: `${AT$13} server.go:192, :1000-1009 a deadline of 120 s for the handshake of each new connection (ConnectionTimeout)`,
|
|
43
43
|
rung: "implemented"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
ref: `${AT$
|
|
46
|
+
ref: `${AT$13} server.go:894-905 the comment of grpc-go: Go sets a TCP keepalive of 15 s on each accepted connection`,
|
|
47
47
|
rung: "documented"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
@@ -702,7 +702,7 @@ const ETCD_SERVER = serverOf({
|
|
|
702
702
|
});
|
|
703
703
|
//#endregion
|
|
704
704
|
//#region src/grpc/grpc-js.ts
|
|
705
|
-
const AT$
|
|
705
|
+
const AT$12 = "@grpc/grpc-js 1.14.6 src";
|
|
706
706
|
/**
|
|
707
707
|
* This document is grpc-js 1.14.6 on Node, for one channel to one server with no TLS, its transport
|
|
708
708
|
* (one HTTP/2 session on one TCP connection) and one unary call on it. It gives the states of the
|
|
@@ -732,83 +732,83 @@ const GRPC_JS = machineSchema.parse({
|
|
|
732
732
|
},
|
|
733
733
|
sources: [
|
|
734
734
|
{
|
|
735
|
-
ref: `${AT$
|
|
735
|
+
ref: `${AT$12}/transport.ts:70 KEEPALIVE_TIMEOUT_MS is 20000`,
|
|
736
736
|
rung: "implemented"
|
|
737
737
|
},
|
|
738
738
|
{
|
|
739
|
-
ref: `${AT$
|
|
739
|
+
ref: `${AT$12}/transport.ts:183-198 grpc.keepalive_time_ms is -1 when the caller gives none, grpc.keepalive_timeout_ms is 20000, and grpc.keepalive_permit_without_calls is false`,
|
|
740
740
|
rung: "implemented"
|
|
741
741
|
},
|
|
742
742
|
{
|
|
743
|
-
ref: `${AT$
|
|
743
|
+
ref: `${AT$12}/transport.ts:447-453 a PING goes out only with a keepalive time above 0, and with a call in flight or permit_without_calls`,
|
|
744
744
|
rung: "implemented"
|
|
745
745
|
},
|
|
746
746
|
{
|
|
747
|
-
ref: `${AT$
|
|
747
|
+
ref: `${AT$12}/transport.ts:455-507 each PING starts a timer of keepalive_timeout_ms, and its end with no ACK ends the transport (handleDisconnect). A failed send of the PING ends it too`,
|
|
748
748
|
rung: "implemented"
|
|
749
749
|
},
|
|
750
750
|
{
|
|
751
|
-
ref: `${AT$
|
|
751
|
+
ref: `${AT$12}/transport.ts:515-534 and :553-561 the keepalive timer starts with the first call in flight, and after each ACK. It is not reset by data. When it ends with no call in flight, the PING goes out at the start of the next call`,
|
|
752
752
|
rung: "implemented"
|
|
753
753
|
},
|
|
754
754
|
{
|
|
755
|
-
ref: `${AT$
|
|
755
|
+
ref: `${AT$12}/transport.ts:200-242 a close or an error of the session, or a close of its socket, ends the transport. A GOAWAY makes it unusable (reportDisconnectToOwner)`,
|
|
756
756
|
rung: "implemented"
|
|
757
757
|
},
|
|
758
758
|
{
|
|
759
|
-
ref: `${AT$
|
|
759
|
+
ref: `${AT$12}/transport.ts:205-227 a GOAWAY ENHANCE_YOUR_CALM with the data too_many_pings tells the subchannel that the server refused the pings`,
|
|
760
760
|
rung: "implemented"
|
|
761
761
|
},
|
|
762
762
|
{
|
|
763
|
-
ref: `${AT$
|
|
763
|
+
ref: `${AT$12}/transport.ts:431-441 handleDisconnect: each call in flight gets onDisconnect, and the session is destroyed in the next turn of the event loop`,
|
|
764
764
|
rung: "implemented"
|
|
765
765
|
},
|
|
766
766
|
{
|
|
767
|
-
ref: `${AT$
|
|
767
|
+
ref: `${AT$12}/transport.ts:684-687 shutdown closes the session: a GOAWAY, then the end of the socket after the last stream`,
|
|
768
768
|
rung: "implemented"
|
|
769
769
|
},
|
|
770
770
|
{
|
|
771
|
-
ref: `${AT$
|
|
771
|
+
ref: `${AT$12}/transport.ts:792-810 the transport is ready at the first SETTINGS of the server (remoteSettings)`,
|
|
772
772
|
rung: "implemented"
|
|
773
773
|
},
|
|
774
774
|
{
|
|
775
|
-
ref: `${AT$
|
|
775
|
+
ref: `${AT$12}/transport.ts:818-840 the TCP connect is net.connect with no timeout`,
|
|
776
776
|
rung: "implemented"
|
|
777
777
|
},
|
|
778
778
|
{
|
|
779
|
-
ref: `${AT$
|
|
779
|
+
ref: `${AT$12}/transport.ts:862 setNoDelay on each connection: TCP_NODELAY, thus no Nagle. No setKeepAlive anywhere in the package`,
|
|
780
780
|
rung: "implemented"
|
|
781
781
|
},
|
|
782
782
|
{
|
|
783
|
-
ref: `${AT$
|
|
783
|
+
ref: `${AT$12}/subchannel-call.ts:360-371 onDisconnect ends the call with UNAVAILABLE 'Connection dropped' in the next turn of the event loop, unless the stream ends first`,
|
|
784
784
|
rung: "implemented"
|
|
785
785
|
},
|
|
786
786
|
{
|
|
787
|
-
ref: `${AT$
|
|
787
|
+
ref: `${AT$12}/subchannel-call.ts:230-329 the end of a stream with no status: REFUSED_STREAM is UNAVAILABLE, CANCEL after a dropped connection is UNAVAILABLE, and an internal error of ECONNRESET or ETIMEDOUT is UNAVAILABLE`,
|
|
788
788
|
rung: "implemented"
|
|
789
789
|
},
|
|
790
790
|
{
|
|
791
|
-
ref: `${AT$
|
|
791
|
+
ref: `${AT$12}/load-balancing-call.ts:257-261 a stream that the server refused has the progress REFUSED, and any other started stream PROCESSED`,
|
|
792
792
|
rung: "implemented"
|
|
793
793
|
},
|
|
794
794
|
{
|
|
795
|
-
ref: `${AT$
|
|
795
|
+
ref: `${AT$12}/retrying-call.ts:631-652 a transparent retry for NOT_STARTED, and one for REFUSED. A PROCESSED call is retried only by a retry policy of the service config, which the defaults do not have`,
|
|
796
796
|
rung: "implemented"
|
|
797
797
|
},
|
|
798
798
|
{
|
|
799
|
-
ref: `${AT$
|
|
799
|
+
ref: `${AT$12}/load-balancing-call.ts:338-345 a pick in TRANSIENT_FAILURE fails the call at once, unless it asks for waitForReady`,
|
|
800
800
|
rung: "implemented"
|
|
801
801
|
},
|
|
802
802
|
{
|
|
803
|
-
ref: `${AT$
|
|
803
|
+
ref: `${AT$12}/resolving-call.ts:118-180 the deadline of a call is a timer from the start of the call. Its end cancels the call with DEADLINE_EXCEEDED`,
|
|
804
804
|
rung: "implemented"
|
|
805
805
|
},
|
|
806
806
|
{
|
|
807
|
-
ref: `${AT$
|
|
807
|
+
ref: `${AT$12}/deadline.ts:39-52 the header grpc-timeout is the time left to the deadline when the call sends its headers, rounded up to whole milliseconds. A server can start a timer of it`,
|
|
808
808
|
rung: "implemented"
|
|
809
809
|
},
|
|
810
810
|
{
|
|
811
|
-
ref: `${AT$
|
|
811
|
+
ref: `${AT$12}/subchannel-call.ts:269-279 a RST_STREAM CANCEL of the server ends the call with CANCELLED 'Call cancelled'`,
|
|
812
812
|
rung: "implemented"
|
|
813
813
|
},
|
|
814
814
|
{
|
|
@@ -816,19 +816,19 @@ const GRPC_JS = machineSchema.parse({
|
|
|
816
816
|
rung: "observed"
|
|
817
817
|
},
|
|
818
818
|
{
|
|
819
|
-
ref: `${AT$
|
|
819
|
+
ref: `${AT$12}/subchannel.ts:275-291 the end of the transport takes the subchannel from READY to IDLE. After too_many_pings the keepalive time doubles`,
|
|
820
820
|
rung: "implemented"
|
|
821
821
|
},
|
|
822
822
|
{
|
|
823
|
-
ref: `${AT$
|
|
823
|
+
ref: `${AT$12}/subchannel.ts:298-304 a failed connect takes the subchannel to TRANSIENT_FAILURE`,
|
|
824
824
|
rung: "implemented"
|
|
825
825
|
},
|
|
826
826
|
{
|
|
827
|
-
ref: `${AT$
|
|
827
|
+
ref: `${AT$12}/backoff-timeout.ts:23-26 the reconnect waits 1000 ms first, each next wait 1.6 times longer, up to 120000 ms, with a jitter of 0.2`,
|
|
828
828
|
rung: "implemented"
|
|
829
829
|
},
|
|
830
830
|
{
|
|
831
|
-
ref: `${AT$
|
|
831
|
+
ref: `${AT$12}/internal-channel.ts:74-77 and :324-325 a channel with no call for grpc.client_idle_timeout_ms goes IDLE: 30 min at the defaults, 1 s at least`,
|
|
832
832
|
rung: "implemented"
|
|
833
833
|
},
|
|
834
834
|
{
|
|
@@ -2581,8 +2581,224 @@ const UNDICI_CLIENT = machineSchema.parse({
|
|
|
2581
2581
|
}
|
|
2582
2582
|
});
|
|
2583
2583
|
//#endregion
|
|
2584
|
+
//#region src/http/undici-retry.ts
|
|
2585
|
+
const AT$11 = "undici 8.12.2 lib/handler/retry-handler.js";
|
|
2586
|
+
/**
|
|
2587
|
+
* This document is one request through a `RetryAgent` of undici 8.12.2: the retries of a reply
|
|
2588
|
+
* whose status is retryable, for example 429 or 503. Each fact comes from the published package at
|
|
2589
|
+
* 8.12.2, with the file and the line. The defaults are 5 retries, a backoff from 500 ms with a factor
|
|
2590
|
+
* of 2, a cap of 30 s, and Retry-After read.
|
|
2591
|
+
*
|
|
2592
|
+
* - The delay of a retry is the Retry-After of the reply, capped by `maxTimeout`. A Retry-After
|
|
2593
|
+
* longer than the cap does not stop the retries: the retry comes early. A reply without
|
|
2594
|
+
* Retry-After gets the backoff, with no jitter.
|
|
2595
|
+
* - The agent gives up after `maxRetries` retries. The caller then gets `RequestRetryError`, with
|
|
2596
|
+
* the status of the last reply. Thus the retry window of the caller is the sum of the delays.
|
|
2597
|
+
* - A POST and a PATCH are not retried.
|
|
2598
|
+
* - The delay is a native Node timer. It arms after the parse of the whole reply, thus it comes after
|
|
2599
|
+
* the last segment by the handling time of the program. No source bounds that time, and this
|
|
2600
|
+
* document does not hold it. The cells add it from a calibration (`HANDLING` in
|
|
2601
|
+
* `packages/cells/src/http/race.ts`).
|
|
2602
|
+
*
|
|
2603
|
+
* The plain `Client` and `fetch` of undici, and the `fetch` of Node 24.21.0 (undici 7.29.1), send no
|
|
2604
|
+
* request again for a status. Their retry window is 0.
|
|
2605
|
+
*/
|
|
2606
|
+
const UNDICI_RETRY = machineSchema.parse({
|
|
2607
|
+
format: "mark1russell7.machine/1",
|
|
2608
|
+
id: "undici-retry-agent",
|
|
2609
|
+
title: "One request through a RetryAgent of undici 8.12.2",
|
|
2610
|
+
layer: "driver",
|
|
2611
|
+
version: "8.12.2",
|
|
2612
|
+
conditions: {
|
|
2613
|
+
undici: "8.12.2",
|
|
2614
|
+
node: "24.21.0",
|
|
2615
|
+
throwOnError: "true"
|
|
2616
|
+
},
|
|
2617
|
+
sources: [
|
|
2618
|
+
{
|
|
2619
|
+
ref: `${AT$11}:125-133 the defaults: retryAfter true, maxTimeout 30000, minTimeout 500, timeoutFactor 2, maxRetries 5, the methods GET HEAD OPTIONS PUT DELETE TRACE QUERY, the statusCodes 500 502 503 504 429`,
|
|
2620
|
+
rung: "implemented"
|
|
2621
|
+
},
|
|
2622
|
+
{
|
|
2623
|
+
ref: "undici 8.12.2 lib/dispatcher/retry-agent.js:18-27: a RetryAgent wraps a dispatcher with a RetryHandler",
|
|
2624
|
+
rung: "implemented"
|
|
2625
|
+
},
|
|
2626
|
+
{
|
|
2627
|
+
ref: `${AT$11}:331-351 the policy: a method or a status out of its lists is not retried, and a counter above maxRetries gives up`,
|
|
2628
|
+
rung: "implemented"
|
|
2629
|
+
},
|
|
2630
|
+
{
|
|
2631
|
+
ref: `${AT$11}:353-370 the delay: Retry-After in seconds times 1000, or an HTTP-date less the clock of the client (:13-16), capped by maxTimeout; 0 at once; else min(minTimeout * timeoutFactor^(counter - 1), maxTimeout); then setTimeout`,
|
|
2632
|
+
rung: "implemented"
|
|
2633
|
+
},
|
|
2634
|
+
{
|
|
2635
|
+
ref: `${AT$11}:380 the counter: one more at each reply`,
|
|
2636
|
+
rung: "implemented"
|
|
2637
|
+
},
|
|
2638
|
+
{
|
|
2639
|
+
ref: `${AT$11}:175-192 and :518-535 a retryable status with throwOnError drops the body of the reply, and the error goes to the policy`,
|
|
2640
|
+
rung: "implemented"
|
|
2641
|
+
},
|
|
2642
|
+
{
|
|
2643
|
+
ref: "undici 8.12.2 lib/core/errors.js:362-371 RequestRetryError: code UND_ERR_REQ_RETRY, statusCode, headers, data.count",
|
|
2644
|
+
rung: "implemented"
|
|
2645
|
+
},
|
|
2646
|
+
{
|
|
2647
|
+
ref: "RFC 9110 §10.2.3: Retry-After, as delay-seconds or an HTTP-date",
|
|
2648
|
+
rung: "normative"
|
|
2649
|
+
}
|
|
2650
|
+
],
|
|
2651
|
+
states: {
|
|
2652
|
+
IDLE: {
|
|
2653
|
+
initial: true,
|
|
2654
|
+
pseudo: true
|
|
2655
|
+
},
|
|
2656
|
+
SENT: { note: "a send of the request waits for its reply" },
|
|
2657
|
+
WAITING: { note: "the delay of a retry: the Retry-After of the reply, or the backoff" },
|
|
2658
|
+
DONE: {
|
|
2659
|
+
final: true,
|
|
2660
|
+
note: "a reply whose status is not retryable goes to the caller"
|
|
2661
|
+
},
|
|
2662
|
+
FAILED: {
|
|
2663
|
+
final: true,
|
|
2664
|
+
note: "RequestRetryError (UND_ERR_REQ_RETRY), with the status of the last reply"
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2667
|
+
events: {
|
|
2668
|
+
"req.dispatch": { kind: "app" },
|
|
2669
|
+
"rx.retryable": {
|
|
2670
|
+
kind: "rx",
|
|
2671
|
+
note: "a reply with a status of statusCodes, for example 429 with Retry-After"
|
|
2672
|
+
},
|
|
2673
|
+
"rx.final": {
|
|
2674
|
+
kind: "rx",
|
|
2675
|
+
note: "a reply with another status, for example 200"
|
|
2676
|
+
},
|
|
2677
|
+
"timer.retry": { kind: "timer" }
|
|
2678
|
+
},
|
|
2679
|
+
knobs: {
|
|
2680
|
+
maxRetries: {
|
|
2681
|
+
key: "undici RetryAgent maxRetries",
|
|
2682
|
+
scope: "client",
|
|
2683
|
+
unit: "count",
|
|
2684
|
+
default: 5
|
|
2685
|
+
},
|
|
2686
|
+
minTimeout: {
|
|
2687
|
+
key: "undici RetryAgent minTimeout",
|
|
2688
|
+
scope: "client",
|
|
2689
|
+
unit: "ms",
|
|
2690
|
+
default: 500
|
|
2691
|
+
},
|
|
2692
|
+
maxTimeout: {
|
|
2693
|
+
key: "undici RetryAgent maxTimeout",
|
|
2694
|
+
scope: "client",
|
|
2695
|
+
unit: "ms",
|
|
2696
|
+
default: 3e4
|
|
2697
|
+
},
|
|
2698
|
+
timeoutFactor: {
|
|
2699
|
+
key: "undici RetryAgent timeoutFactor",
|
|
2700
|
+
scope: "client",
|
|
2701
|
+
unit: "count",
|
|
2702
|
+
default: 2
|
|
2703
|
+
},
|
|
2704
|
+
retry_after: {
|
|
2705
|
+
key: "Retry-After of the reply, in seconds",
|
|
2706
|
+
scope: "reply",
|
|
2707
|
+
unit: "s",
|
|
2708
|
+
default: null,
|
|
2709
|
+
note: "the server gives it. An HTTP-date counts on the clock of the client"
|
|
2710
|
+
},
|
|
2711
|
+
hz: {
|
|
2712
|
+
key: "CONFIG_HZ",
|
|
2713
|
+
scope: "global",
|
|
2714
|
+
unit: "Hz",
|
|
2715
|
+
default: null,
|
|
2716
|
+
note: "the HZ of the kernel, for the step of the coarse loop clock of libuv (timers.ts)"
|
|
2717
|
+
}
|
|
2718
|
+
},
|
|
2719
|
+
timers: {
|
|
2720
|
+
retry_after: {
|
|
2721
|
+
duration: {
|
|
2722
|
+
expr: "min(retry_after * 1000, maxTimeout)",
|
|
2723
|
+
unit: "ms"
|
|
2724
|
+
},
|
|
2725
|
+
lateness: nodeTimerLateness("min(retry_after * 1000, maxTimeout)"),
|
|
2726
|
+
early: NODE_TIMER_EARLY,
|
|
2727
|
+
arms: ["enter:WAITING"],
|
|
2728
|
+
cancels: ["req.dispatch"],
|
|
2729
|
+
fires: "timer.retry",
|
|
2730
|
+
note: "setTimeout(cb, retryTimeout) with the Retry-After of the reply. It arms after the parse of the whole reply"
|
|
2731
|
+
},
|
|
2732
|
+
backoff: {
|
|
2733
|
+
duration: {
|
|
2734
|
+
expr: "min(minTimeout * pow(timeoutFactor, fired), maxTimeout)",
|
|
2735
|
+
unit: "ms"
|
|
2736
|
+
},
|
|
2737
|
+
lateness: nodeTimerLateness("min(minTimeout * pow(timeoutFactor, fired), maxTimeout)"),
|
|
2738
|
+
early: NODE_TIMER_EARLY,
|
|
2739
|
+
arms: ["enter:WAITING"],
|
|
2740
|
+
cancels: ["req.dispatch"],
|
|
2741
|
+
fires: "timer.retry",
|
|
2742
|
+
backoff: { resets: ["req.dispatch"] },
|
|
2743
|
+
note: "a reply without Retry-After: 0.5, 1, 2, 4 and 8 s at the defaults, with no jitter"
|
|
2744
|
+
}
|
|
2745
|
+
},
|
|
2746
|
+
transitions: [
|
|
2747
|
+
{
|
|
2748
|
+
id: "ur.send",
|
|
2749
|
+
from: "IDLE",
|
|
2750
|
+
to: "SENT",
|
|
2751
|
+
on: "req.dispatch"
|
|
2752
|
+
},
|
|
2753
|
+
{
|
|
2754
|
+
id: "ur.wait",
|
|
2755
|
+
from: "SENT",
|
|
2756
|
+
to: "WAITING",
|
|
2757
|
+
on: "rx.retryable",
|
|
2758
|
+
guard: "the count of replies is maxRetries or less, the method is in its list, and no part of the body went to the caller",
|
|
2759
|
+
source: "retry-handler.js:331-351, :380, :581-584"
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
id: "ur.give-up",
|
|
2763
|
+
from: "SENT",
|
|
2764
|
+
to: "FAILED",
|
|
2765
|
+
on: "rx.retryable",
|
|
2766
|
+
guard: "the count of replies is above maxRetries, or the method is not in its list (POST, PATCH)",
|
|
2767
|
+
errno: "UND_ERR_REQ_RETRY",
|
|
2768
|
+
source: "retry-handler.js:331-335, :347-350, :430-436"
|
|
2769
|
+
},
|
|
2770
|
+
{
|
|
2771
|
+
id: "ur.retry-after",
|
|
2772
|
+
from: "WAITING",
|
|
2773
|
+
to: "SENT",
|
|
2774
|
+
on: "timer.retry",
|
|
2775
|
+
timer: "retry_after",
|
|
2776
|
+
guard: "the reply had a Retry-After of 0 or more",
|
|
2777
|
+
emits: ["tx.request"],
|
|
2778
|
+
source: "retry-handler.js:353-365, :370"
|
|
2779
|
+
},
|
|
2780
|
+
{
|
|
2781
|
+
id: "ur.backoff",
|
|
2782
|
+
from: "WAITING",
|
|
2783
|
+
to: "SENT",
|
|
2784
|
+
on: "timer.retry",
|
|
2785
|
+
timer: "backoff",
|
|
2786
|
+
guard: "the reply had no Retry-After, or one in the past, or one that does not parse",
|
|
2787
|
+
emits: ["tx.request"],
|
|
2788
|
+
source: "retry-handler.js:361-370"
|
|
2789
|
+
},
|
|
2790
|
+
{
|
|
2791
|
+
id: "ur.done",
|
|
2792
|
+
from: "SENT",
|
|
2793
|
+
to: "DONE",
|
|
2794
|
+
on: "rx.final",
|
|
2795
|
+
source: "retry-handler.js:373-383"
|
|
2796
|
+
}
|
|
2797
|
+
]
|
|
2798
|
+
});
|
|
2799
|
+
//#endregion
|
|
2584
2800
|
//#region src/ioredis-sentinel.ts
|
|
2585
|
-
const AT$
|
|
2801
|
+
const AT$10 = "ioredis 6.0.0 built";
|
|
2586
2802
|
/**
|
|
2587
2803
|
* This document is the Sentinel path of ioredis 6.0.0. It tells how ioredis finds the primary of a
|
|
2588
2804
|
* group through the Sentinels, loses it, and connects to the new one. The standalone states of
|
|
@@ -2603,43 +2819,43 @@ const IOREDIS_SENTINEL = machineSchema.parse({
|
|
|
2603
2819
|
},
|
|
2604
2820
|
sources: [
|
|
2605
2821
|
{
|
|
2606
|
-
ref: `${AT$
|
|
2822
|
+
ref: `${AT$10}/connectors/SentinelConnector/index.js:46-121 connect (each Sentinel in turn, then sentinelRetryStrategy)`,
|
|
2607
2823
|
rung: "implemented"
|
|
2608
2824
|
},
|
|
2609
2825
|
{
|
|
2610
|
-
ref: `${AT$
|
|
2826
|
+
ref: `${AT$10}/connectors/SentinelConnector/index.js:145-151 resolveMaster (get-master-addr-by-name, then SENTINEL sentinels)`,
|
|
2611
2827
|
rung: "implemented"
|
|
2612
2828
|
},
|
|
2613
2829
|
{
|
|
2614
|
-
ref: `${AT$
|
|
2830
|
+
ref: `${AT$10}/connectors/SentinelConnector/index.js:175-212 connectToSentinel and resolve (one connection for each question, no retry)`,
|
|
2615
2831
|
rung: "implemented"
|
|
2616
2832
|
},
|
|
2617
2833
|
{
|
|
2618
|
-
ref: `${AT$
|
|
2834
|
+
ref: `${AT$10}/connectors/SentinelConnector/index.js:27-39 check (the role of the ready check)`,
|
|
2619
2835
|
rung: "implemented"
|
|
2620
2836
|
},
|
|
2621
2837
|
{
|
|
2622
|
-
ref: `${AT$
|
|
2838
|
+
ref: `${AT$10}/connectors/SentinelConnector/FailoverDetector.js:6-43 (+switch-master, only with failoverDetector)`,
|
|
2623
2839
|
rung: "implemented"
|
|
2624
2840
|
},
|
|
2625
2841
|
{
|
|
2626
|
-
ref: `${AT$
|
|
2842
|
+
ref: `${AT$10}/redis/RedisOptions.js:9-57 (the defaults)`,
|
|
2627
2843
|
rung: "implemented"
|
|
2628
2844
|
},
|
|
2629
2845
|
{
|
|
2630
|
-
ref: `${AT$
|
|
2846
|
+
ref: `${AT$10}/redis/event_handler.js:294-355 closeHandler (retryStrategy, then maxRetriesPerRequest flushes the queue)`,
|
|
2631
2847
|
rung: "implemented"
|
|
2632
2848
|
},
|
|
2633
2849
|
{
|
|
2634
|
-
ref: `${AT$
|
|
2850
|
+
ref: `${AT$10}/redis/event_handler.js:364-449 readyHandler (retryAttempts back to 0, the resend, the offline queue)`,
|
|
2635
2851
|
rung: "implemented"
|
|
2636
2852
|
},
|
|
2637
2853
|
{
|
|
2638
|
-
ref: `${AT$
|
|
2854
|
+
ref: `${AT$10}/Redis.js:123-240 _connect (connectTimeout, keepAlive) and :379-405 sendCommand (the offline queue)`,
|
|
2639
2855
|
rung: "implemented"
|
|
2640
2856
|
},
|
|
2641
2857
|
{
|
|
2642
|
-
ref: `${AT$
|
|
2858
|
+
ref: `${AT$10}/Redis.js:599-605 handleReconnection (reconnectOnError: null, thus a READONLY error goes to the caller)`,
|
|
2643
2859
|
rung: "implemented"
|
|
2644
2860
|
}
|
|
2645
2861
|
],
|
|
@@ -4799,7 +5015,7 @@ const IOREDIS_STATUS = machineSchema.parse(ioredis_status_default);
|
|
|
4799
5015
|
const MANIFESTATIONS = z.record(z.string(), z.array(z.string())).parse(manifestations_default);
|
|
4800
5016
|
//#endregion
|
|
4801
5017
|
//#region src/mongo/mongod-replication.ts
|
|
4802
|
-
const AT$
|
|
5018
|
+
const AT$9 = "mongodb r9.0.4 src/mongo/db/repl";
|
|
4803
5019
|
/**
|
|
4804
5020
|
* This document is the replication of mongod 9.0.4. It gives one member of a replica set, its view
|
|
4805
5021
|
* of the primary, and the election that it can hold. The states are the states of the member. The
|
|
@@ -4830,95 +5046,95 @@ const MONGOD_REPL = machineSchema.parse({
|
|
|
4830
5046
|
},
|
|
4831
5047
|
sources: [
|
|
4832
5048
|
{
|
|
4833
|
-
ref: `${AT$
|
|
5049
|
+
ref: `${AT$9}/repl_set_config.idl:74-109 the settings: heartbeatIntervalMillis 2000, heartbeatTimeoutSecs 10, electionTimeoutMillis 10000, catchUpTimeoutMillis -1, catchUpTakeoverDelayMillis 30000`,
|
|
4834
5050
|
rung: "implemented"
|
|
4835
5051
|
},
|
|
4836
5052
|
{
|
|
4837
|
-
ref: `${AT$
|
|
5053
|
+
ref: `${AT$9}/repl_server_parameters.idl:320-328 replElectionTimeoutOffsetLimitFraction 0.15`,
|
|
4838
5054
|
rung: "implemented"
|
|
4839
5055
|
},
|
|
4840
5056
|
{
|
|
4841
|
-
ref: `${AT$
|
|
5057
|
+
ref: `${AT$9}/topology_coordinator.cpp:1058-1101 the heartbeat window and the timeout of each request, :1124-1147 the next heartbeat, :1239-1248 a member DOWN`,
|
|
4842
5058
|
rung: "implemented"
|
|
4843
5059
|
},
|
|
4844
5060
|
{
|
|
4845
|
-
ref: `${AT$
|
|
5061
|
+
ref: `${AT$9}/topology_coordinator.h:62 kMaxHeartbeatRetries 2`,
|
|
4846
5062
|
rung: "implemented"
|
|
4847
5063
|
},
|
|
4848
5064
|
{
|
|
4849
|
-
ref: `${AT$
|
|
5065
|
+
ref: `${AT$9}/replication_coordinator_impl_heartbeat.cpp:97-111 the random offset, :346-352 a heartbeat from the primary postpones the election, :1215-1271 the election timeout and its offset`,
|
|
4850
5066
|
rung: "implemented"
|
|
4851
5067
|
},
|
|
4852
5068
|
{
|
|
4853
|
-
ref: `${AT$
|
|
5069
|
+
ref: `${AT$9}/data_replicator_external_state_impl.cpp:70-81 an oplog batch that names a primary postpones the election`,
|
|
4854
5070
|
rung: "implemented"
|
|
4855
5071
|
},
|
|
4856
5072
|
{
|
|
4857
|
-
ref: `${AT$
|
|
5073
|
+
ref: `${AT$9}/delayable_timeout_callback.cpp:149-172 the offset changes at most once in its own length`,
|
|
4858
5074
|
rung: "implemented"
|
|
4859
5075
|
},
|
|
4860
5076
|
{
|
|
4861
|
-
ref: `${AT$
|
|
5077
|
+
ref: `${AT$9}/topology_coordinator.cpp:1440-1457 and :1476-1489 the liveness check: a primary that cannot see a majority steps down`,
|
|
4862
5078
|
rung: "implemented"
|
|
4863
5079
|
},
|
|
4864
5080
|
{
|
|
4865
|
-
ref: `${AT$
|
|
5081
|
+
ref: `${AT$9}/replication_coordinator_impl_heartbeat.cpp:1158-1188 the liveness check runs at the stalest member's last update plus the election timeout`,
|
|
4866
5082
|
rung: "implemented"
|
|
4867
5083
|
},
|
|
4868
5084
|
{
|
|
4869
|
-
ref: `${AT$
|
|
5085
|
+
ref: `${AT$9}/replication_coordinator_impl_elect_v1.cpp:189-226 the dry run, :268-382 the term, the durable vote and the real vote, :408-468 the win`,
|
|
4870
5086
|
rung: "implemented"
|
|
4871
5087
|
},
|
|
4872
5088
|
{
|
|
4873
|
-
ref: `${AT$
|
|
5089
|
+
ref: `${AT$9}/vote_requester.cpp:96 a vote request times out at min(electionTimeoutMillis, 30 s), :160-177 a majority of yes votes ends the round`,
|
|
4874
5090
|
rung: "implemented"
|
|
4875
5091
|
},
|
|
4876
5092
|
{
|
|
4877
|
-
ref: `${AT$
|
|
5093
|
+
ref: `${AT$9}/topology_coordinator.cpp:3741-3790 a member votes for each candidate whose data is not staler than its own, and only an arbiter refuses one because it sees a primary`,
|
|
4878
5094
|
rung: "implemented"
|
|
4879
5095
|
},
|
|
4880
5096
|
{
|
|
4881
|
-
ref: `${AT$
|
|
5097
|
+
ref: `${AT$9}/replication_coordinator_impl_catchup.cpp:35-85 the catch-up and its timeout, :110-133 it ends when each other member answered a heartbeat since the win, or failed one, :349-379 the win restarts each heartbeat`,
|
|
4882
5098
|
rung: "implemented"
|
|
4883
5099
|
},
|
|
4884
5100
|
{
|
|
4885
|
-
ref: `${AT$
|
|
5101
|
+
ref: `${AT$9}/topology_coordinator.cpp:3841-3849 and :3910-3932 a restarted heartbeat, and the latest optime that the catch-up waits for`,
|
|
4886
5102
|
rung: "implemented"
|
|
4887
5103
|
},
|
|
4888
5104
|
{
|
|
4889
|
-
ref: `${AT$
|
|
5105
|
+
ref: `${AT$9}/replication_coordinator_impl.cpp:1490-1570 the end of the drain: a reconfig of the term, then writes, :2580-2588 the hello of a primary that cannot write yet`,
|
|
4890
5106
|
rung: "implemented"
|
|
4891
5107
|
},
|
|
4892
5108
|
{
|
|
4893
|
-
ref: `${AT$
|
|
5109
|
+
ref: `${AT$9}/replication_coordinator_impl_step_up_step_down.cpp:64-329 replSetStepDown: the wait for a caught-up secondary, the step-down and the hand-off`,
|
|
4894
5110
|
rung: "implemented"
|
|
4895
5111
|
},
|
|
4896
5112
|
{
|
|
4897
|
-
ref: `${AT$
|
|
5113
|
+
ref: `${AT$9}/repl_set_commands.cpp:545-561 stepDownSecs 60 and secondaryCatchUpPeriodSecs 10`,
|
|
4898
5114
|
rung: "implemented"
|
|
4899
5115
|
},
|
|
4900
5116
|
{
|
|
4901
|
-
ref: `${AT$
|
|
5117
|
+
ref: `${AT$9}/replication_coordinator_impl.idl:18-26 enableElectionHandoff true, and replication_coordinator_impl.cpp:2830-2873 the hand-off: replSetStepUp with skipDryRun`,
|
|
4902
5118
|
rung: "implemented"
|
|
4903
5119
|
},
|
|
4904
5120
|
{
|
|
4905
|
-
ref: `${AT$
|
|
5121
|
+
ref: `${AT$9}/replication_coordinator_impl.cpp:1516 the reconfig of the term, :4598 and :4750 a new config starts each heartbeat again`,
|
|
4906
5122
|
rung: "implemented"
|
|
4907
5123
|
},
|
|
4908
5124
|
{
|
|
4909
|
-
ref: `${AT$
|
|
5125
|
+
ref: `${AT$9}/replication_coordinator_impl_heartbeat.cpp:367-376 a heartbeat response that moves a member's optime forward moves the commit point and wakes the writes that wait`,
|
|
4910
5126
|
rung: "implemented"
|
|
4911
5127
|
},
|
|
4912
5128
|
{
|
|
4913
|
-
ref: `${AT$
|
|
5129
|
+
ref: `${AT$9}/oplog_fetcher.cpp:119-133 the awaitData timeout min(electionTimeoutMillis / 2, 30 s), :317-324 the socket timeout adds oplogNetworkTimeoutBufferSeconds, :640-647 the exhaust read`,
|
|
4914
5130
|
rung: "implemented"
|
|
4915
5131
|
},
|
|
4916
5132
|
{
|
|
4917
|
-
ref: `${AT$
|
|
5133
|
+
ref: `${AT$9}/oplog_fetcher.cpp:395-441 an error makes a new cursor while restarts remain, :596-611 the new cursor sets the retried find timeout, :1073-1113 one restart after 5 ms`,
|
|
4918
5134
|
rung: "implemented"
|
|
4919
5135
|
},
|
|
4920
5136
|
{
|
|
4921
|
-
ref: `${AT$
|
|
5137
|
+
ref: `${AT$9}/repl_server_parameters.idl:121-126 oplogRetriedFindMaxSeconds 2, :234-244 oplogFetcherSteadyStateMaxFetcherRestarts 1, :344-351 oplogNetworkTimeoutBufferSeconds 5`,
|
|
4922
5138
|
rung: "implemented"
|
|
4923
5139
|
},
|
|
4924
5140
|
{
|
|
@@ -4926,19 +5142,19 @@ const MONGOD_REPL = machineSchema.parse({
|
|
|
4926
5142
|
rung: "implemented"
|
|
4927
5143
|
},
|
|
4928
5144
|
{
|
|
4929
|
-
ref: `${AT$
|
|
5145
|
+
ref: `${AT$9}/bgsync.cpp:395-447 a member without a sync source waits for new heartbeat data or 1 s (:971-976), and topology_coordinator.cpp:1124-1136 it sends its heartbeats each 500 ms`,
|
|
4930
5146
|
rung: "implemented"
|
|
4931
5147
|
},
|
|
4932
5148
|
{
|
|
4933
|
-
ref: `${AT$
|
|
5149
|
+
ref: `${AT$9}/replication_coordinator_impl.cpp:4947-4972 a member that loses its sync source starts each heartbeat again at once`,
|
|
4934
5150
|
rung: "implemented"
|
|
4935
5151
|
},
|
|
4936
5152
|
{
|
|
4937
|
-
ref: `${AT$
|
|
5153
|
+
ref: `${AT$9}/sync_source_feedback.cpp:37-47 the keepalive of the reporter min(electionTimeoutMillis / 2, 30 s), :39-40 the network timeout 30 s, :99-117 and :134-236 a new reporter only after the old one ends`,
|
|
4938
5154
|
rung: "implemented"
|
|
4939
5155
|
},
|
|
4940
5156
|
{
|
|
4941
|
-
ref: `${AT$
|
|
5157
|
+
ref: `${AT$9}/reporter.cpp:113-117 a reporter ends when its command in flight ends, :119-169 a trigger, :195-228 each replSetUpdatePosition has the network timeout`,
|
|
4942
5158
|
rung: "implemented"
|
|
4943
5159
|
},
|
|
4944
5160
|
{
|
|
@@ -5557,7 +5773,7 @@ const MONGOD_REPL = machineSchema.parse({
|
|
|
5557
5773
|
});
|
|
5558
5774
|
//#endregion
|
|
5559
5775
|
//#region src/mongo/mongod-session.ts
|
|
5560
|
-
const AT$
|
|
5776
|
+
const AT$8 = "mongodb r9.0.4 src/mongo";
|
|
5561
5777
|
/**
|
|
5562
5778
|
* This document is the hold of mongod 9.0.4 on one client connection, over its socket. `mongod`
|
|
5563
5779
|
* turns keepalive on for each TCP session. It lowers two keepalive options of the socket to a
|
|
@@ -5584,27 +5800,27 @@ const MONGOD_SESSION = machineSchema.parse({
|
|
|
5584
5800
|
},
|
|
5585
5801
|
sources: [
|
|
5586
5802
|
{
|
|
5587
|
-
ref: `${AT$
|
|
5803
|
+
ref: `${AT$8}/transport/asio/asio_session_impl.cpp:156-165 each TCP session: TCP_NODELAY, SO_KEEPALIVE, setSocketKeepAliveParams, failures at debug 3 in a release build`,
|
|
5588
5804
|
rung: "implemented"
|
|
5589
5805
|
},
|
|
5590
5806
|
{
|
|
5591
|
-
ref: `${AT$
|
|
5807
|
+
ref: `${AT$8}/util/net/socket_utils.h:15-16 kMaxKeepIdleSecs 300 and kMaxKeepIntvlSecs 1, :19-22 the defaults of setSocketKeepAliveParams`,
|
|
5592
5808
|
rung: "implemented"
|
|
5593
5809
|
},
|
|
5594
5810
|
{
|
|
5595
|
-
ref: `${AT$
|
|
5811
|
+
ref: `${AT$8}/util/net/socket_utils.cpp:165-196 applyMax: read the option, and set the maximum only when the value is higher, :199-220 TCP_KEEPIDLE and TCP_KEEPINTVL, never TCP_KEEPCNT`,
|
|
5596
5812
|
rung: "implemented"
|
|
5597
5813
|
},
|
|
5598
5814
|
{
|
|
5599
|
-
ref: `${AT$
|
|
5815
|
+
ref: `${AT$8}/util/net/socket_utils.cpp:176-181 and :190-194 the log of a failed read or set, at the severity of the caller`,
|
|
5600
5816
|
rung: "implemented"
|
|
5601
5817
|
},
|
|
5602
5818
|
{
|
|
5603
|
-
ref: `${AT$
|
|
5819
|
+
ref: `${AT$8}/util/net/sock.cpp:135-142 the older socket path: SO_KEEPALIVE, then the same maximums, failures as errors`,
|
|
5604
5820
|
rung: "implemented"
|
|
5605
5821
|
},
|
|
5606
5822
|
{
|
|
5607
|
-
ref: `${AT$
|
|
5823
|
+
ref: `${AT$8}/db/repl/replication_info.cpp:131-143 an awaitable hello waits until now + maxAwaitTimeMS on the precise clock, or a change of the topology`,
|
|
5608
5824
|
rung: "implemented"
|
|
5609
5825
|
}
|
|
5610
5826
|
],
|
|
@@ -5766,7 +5982,7 @@ const MONGOD_SESSION = machineSchema.parse({
|
|
|
5766
5982
|
});
|
|
5767
5983
|
//#endregion
|
|
5768
5984
|
//#region src/mongo/mongodb-node.ts
|
|
5769
|
-
const AT$
|
|
5985
|
+
const AT$7 = "mongodb 7.7.0 src";
|
|
5770
5986
|
/**
|
|
5771
5987
|
* This document is the MongoDB Node driver 7.7.0, for one server of a replica set. It gives one
|
|
5772
5988
|
* connection of the driver by its role, and the timers that act on it. The roles are the monitor
|
|
@@ -5793,75 +6009,75 @@ const MONGODB_NODE = machineSchema.parse({
|
|
|
5793
6009
|
},
|
|
5794
6010
|
sources: [
|
|
5795
6011
|
{
|
|
5796
|
-
ref: `${AT$
|
|
6012
|
+
ref: `${AT$7}/connection_string.ts:804-807 connectTimeoutMS 30000, :850-853 heartbeatFrequencyMS 10000, :934-937 minHeartbeatFrequencyMS 500`,
|
|
5797
6013
|
rung: "implemented"
|
|
5798
6014
|
},
|
|
5799
6015
|
{
|
|
5800
|
-
ref: `${AT$
|
|
6016
|
+
ref: `${AT$7}/connection_string.ts:1100-1103 serverSelectionTimeoutMS 30000, :1107-1111 socketTimeoutMS 0, :1178-1182 waitQueueTimeoutMS 0`,
|
|
5801
6017
|
rung: "implemented"
|
|
5802
6018
|
},
|
|
5803
6019
|
{
|
|
5804
|
-
ref: `${AT$
|
|
6020
|
+
ref: `${AT$7}/connection_string.ts:896-898 maxConnecting 2, :906-908 maxIdleTimeMS 0, :910-912 maxPoolSize 100, :930-933 minPoolSize 0, :1075-1082 retryReads and retryWrites true, :1089-1091 serverMonitoringMode auto`,
|
|
5805
6021
|
rung: "implemented"
|
|
5806
6022
|
},
|
|
5807
6023
|
{
|
|
5808
|
-
ref: `${AT$
|
|
6024
|
+
ref: `${AT$7}/cmap/connect.ts:291 DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS 120000, :336-338 keepAlive and noDelay, :378-417 makeSocket: setKeepAlive, setNoDelay, setTimeout(connectTimeoutMS), :432-438 the connect timeout`,
|
|
5809
6025
|
rung: "implemented"
|
|
5810
6026
|
},
|
|
5811
6027
|
{
|
|
5812
|
-
ref: `${AT$
|
|
6028
|
+
ref: `${AT$7}/cmap/connect.ts:117-120 the handshake reads with socketTimeoutMS = connectTimeoutMS`,
|
|
5813
6029
|
rung: "implemented"
|
|
5814
6030
|
},
|
|
5815
6031
|
{
|
|
5816
|
-
ref: `${AT$
|
|
6032
|
+
ref: `${AT$7}/sdam/monitor.ts:245-259 the streaming protocol, :338-371 the awaitable hello: maxAwaitTimeMS = heartbeatFrequencyMS, socketTimeoutMS = connectTimeoutMS + maxAwaitTimeMS`,
|
|
5817
6033
|
rung: "implemented"
|
|
5818
6034
|
},
|
|
5819
6035
|
{
|
|
5820
|
-
ref: `${AT$
|
|
6036
|
+
ref: `${AT$7}/sdam/monitor.ts:273-293 a failed heartbeat: ResetPool, and InterruptInUseConnections for a timeout`,
|
|
5821
6037
|
rung: "implemented"
|
|
5822
6038
|
},
|
|
5823
6039
|
{
|
|
5824
|
-
ref: `${AT$
|
|
6040
|
+
ref: `${AT$7}/sdam/monitor.ts:175-194 reset: the next check after heartbeatFrequencyMS, :609-636 wake: no check sooner than minHeartbeatFrequencyMS, :668-691 the next check after heartbeatFrequencyMS`,
|
|
5825
6041
|
rung: "implemented"
|
|
5826
6042
|
},
|
|
5827
6043
|
{
|
|
5828
|
-
ref: `${AT$
|
|
6044
|
+
ref: `${AT$7}/sdam/monitor.ts:490-565 the RTT pinger: its own connection, a hello each heartbeatFrequencyMS, no socket timeout`,
|
|
5829
6045
|
rung: "implemented"
|
|
5830
6046
|
},
|
|
5831
6047
|
{
|
|
5832
|
-
ref: `${AT$
|
|
6048
|
+
ref: `${AT$7}/cmap/connection.ts:328-334 a socket timeout, 1 ms later, is a MongoNetworkTimeoutError, :461-505 the socket timeout of a command, set again at each reply`,
|
|
5833
6049
|
rung: "implemented"
|
|
5834
6050
|
},
|
|
5835
6051
|
{
|
|
5836
|
-
ref: `${AT$
|
|
6052
|
+
ref: `${AT$7}/sdam/server.ts:186 resetServer, :390-444 handleError, :450-515 decorateCommandError, :532-546 markServerUnknown: a network error that is not a timeout resets the monitor`,
|
|
5837
6053
|
rung: "implemented"
|
|
5838
6054
|
},
|
|
5839
6055
|
{
|
|
5840
|
-
ref: `${AT$
|
|
6056
|
+
ref: `${AT$7}/sdam/topology.ts:559 the selection timeout, :568-572 and :635-664 MongoServerSelectionError, :862-888 updateServers clears the pool, :1082-1089 a waiting selection wakes each monitor`,
|
|
5841
6057
|
rung: "implemented"
|
|
5842
6058
|
},
|
|
5843
6059
|
{
|
|
5844
|
-
ref: `${AT$
|
|
6060
|
+
ref: `${AT$7}/sdam/topology_description.ts:458-467 a primary that another primary replaces is Unknown, and nothing clears its pool`,
|
|
5845
6061
|
rung: "implemented"
|
|
5846
6062
|
},
|
|
5847
6063
|
{
|
|
5848
|
-
ref: `${AT$
|
|
6064
|
+
ref: `${AT$7}/cmap/connection_pool.ts:417-468 clear, :475-481 interruptInUseConnections: PoolClearedOnNetworkError, :584 a connection idle for maxIdleTimeMS is perished at the next check-out`,
|
|
5849
6065
|
rung: "implemented"
|
|
5850
6066
|
},
|
|
5851
6067
|
{
|
|
5852
|
-
ref: `${AT$
|
|
6068
|
+
ref: `${AT$7}/cmap/errors.ts:37-84 PoolClearedError and PoolClearedOnNetworkError, with the label PoolRequestedRetry`,
|
|
5853
6069
|
rung: "implemented"
|
|
5854
6070
|
},
|
|
5855
6071
|
{
|
|
5856
|
-
ref: `${AT$
|
|
6072
|
+
ref: `${AT$7}/operations/execute_operation.ts:252-279 two attempts for a retryable read or write, :375-380 the retry selects a server again, :442-445 canRetry`,
|
|
5857
6073
|
rung: "implemented"
|
|
5858
6074
|
},
|
|
5859
6075
|
{
|
|
5860
|
-
ref: `${AT$
|
|
6076
|
+
ref: `${AT$7}/error.ts:1377-1394 the retryable codes, :1431-1436 isRetryableWriteError: RetryableWriteError or PoolRequestedRetry`,
|
|
5861
6077
|
rung: "implemented"
|
|
5862
6078
|
},
|
|
5863
6079
|
{
|
|
5864
|
-
ref: `${AT$
|
|
6080
|
+
ref: `${AT$7}/timeout.ts:362-372 the legacy timeout context: the selection timeout, and no check-out timeout at waitQueueTimeoutMS 0`,
|
|
5865
6081
|
rung: "implemented"
|
|
5866
6082
|
},
|
|
5867
6083
|
{
|
|
@@ -7541,7 +7757,7 @@ const HIKARICP_PGJDBC = machineSchema.parse({
|
|
|
7541
7757
|
});
|
|
7542
7758
|
//#endregion
|
|
7543
7759
|
//#region src/pg/node-postgres.ts
|
|
7544
|
-
const AT$
|
|
7760
|
+
const AT$6 = "pg 8.23.1 lib";
|
|
7545
7761
|
const POOL = "pg-pool 3.14.0";
|
|
7546
7762
|
/**
|
|
7547
7763
|
* This document is node-postgres 8.23.1 (the npm package pg) with pg-pool 3.14.0, for one client
|
|
@@ -7583,75 +7799,75 @@ const NODE_POSTGRES = machineSchema.parse({
|
|
|
7583
7799
|
rung: "implemented"
|
|
7584
7800
|
},
|
|
7585
7801
|
{
|
|
7586
|
-
ref: `${AT$
|
|
7802
|
+
ref: `${AT$6}/defaults.js:42 max 10 and :46 idleTimeoutMillis 30000: no line of pg or pg-pool reads them, thus a pool does not use them`,
|
|
7587
7803
|
rung: "implemented"
|
|
7588
7804
|
},
|
|
7589
7805
|
{
|
|
7590
|
-
ref: `${AT$
|
|
7806
|
+
ref: `${AT$6}/defaults.js:65, :69, :73 and :76 statement_timeout, lock_timeout, idle_in_transaction_session_timeout and query_timeout are false`,
|
|
7591
7807
|
rung: "implemented"
|
|
7592
7808
|
},
|
|
7593
7809
|
{
|
|
7594
|
-
ref: `${AT$
|
|
7810
|
+
ref: `${AT$6}/defaults.js:63-76 the comments of pg: each of the four is in milliseconds, false is no limit, and query_timeout is on the client side`,
|
|
7595
7811
|
rung: "documented"
|
|
7596
7812
|
},
|
|
7597
7813
|
{
|
|
7598
|
-
ref: `${AT$
|
|
7814
|
+
ref: `${AT$6}/connection-parameters.js:9-23 val: the config, else the default of pg, :121-124 the three timeouts of the server and query_timeout, with no environment variable`,
|
|
7599
7815
|
rung: "implemented"
|
|
7600
7816
|
},
|
|
7601
7817
|
{
|
|
7602
|
-
ref: `${AT$
|
|
7818
|
+
ref: `${AT$6}/client.js:89-98 the Connection gets keepAlive false and keepAliveInitialDelayMillis 0 when the config does not give them, :116 connectionTimeoutMillis 0`,
|
|
7603
7819
|
rung: "implemented"
|
|
7604
7820
|
},
|
|
7605
7821
|
{
|
|
7606
|
-
ref: `${AT$
|
|
7822
|
+
ref: `${AT$6}/stream.js:20-24 and :78-83 outside Cloudflare Workers, the socket is a new net.Socket with no option`,
|
|
7607
7823
|
rung: "implemented"
|
|
7608
7824
|
},
|
|
7609
7825
|
{
|
|
7610
|
-
ref: `${AT$
|
|
7826
|
+
ref: `${AT$6}/connection.js:40-52 setNoDelay(true) before the connect, and setKeepAlive(true, keepAliveInitialDelayMillis) at the connect only when keepAlive is true, :54-65 the error and the close of the socket`,
|
|
7611
7827
|
rung: "implemented"
|
|
7612
7828
|
},
|
|
7613
7829
|
{
|
|
7614
|
-
ref: `${AT$
|
|
7830
|
+
ref: `${AT$6}/client.js:167-176 and :702-737 are the only timers of the client, and connection.js has none: the client sends nothing by itself on an idle connection`,
|
|
7615
7831
|
rung: "implemented"
|
|
7616
7832
|
},
|
|
7617
7833
|
{
|
|
7618
|
-
ref: `${AT$
|
|
7834
|
+
ref: `${AT$6}/client.js:153-230 _connect: no second connect, the connect timer of the client ('timeout expired'), and 'Connection terminated unexpectedly' for an end that the client did not ask for`,
|
|
7619
7835
|
rung: "implemented"
|
|
7620
7836
|
},
|
|
7621
7837
|
{
|
|
7622
|
-
ref: `${AT$
|
|
7838
|
+
ref: `${AT$6}/client.js:373-387 the first ReadyForQuery ends the connect and clears the timer, :398-423 an error before it goes to the connect callback, and an error after it makes the client unqueryable`,
|
|
7623
7839
|
rung: "implemented"
|
|
7624
7840
|
},
|
|
7625
7841
|
{
|
|
7626
|
-
ref: `${AT$
|
|
7842
|
+
ref: `${AT$6}/client.js:426-442 an ErrorResponse fails the active query only, and with no active query it is an error of the client`,
|
|
7627
7843
|
rung: "implemented"
|
|
7628
7844
|
},
|
|
7629
7845
|
{
|
|
7630
|
-
ref: `${AT$
|
|
7846
|
+
ref: `${AT$6}/connection.js:137-145 and pg-protocol 1.16.1 dist/parser.js:142-144, :296-323 an ErrorResponse is a DatabaseError, with the severity and the code that the server gives`,
|
|
7631
7847
|
rung: "implemented"
|
|
7632
7848
|
},
|
|
7633
7849
|
{
|
|
7634
|
-
ref: `${AT$
|
|
7850
|
+
ref: `${AT$6}/client.js:133-151 _errorAllQueries: each query of the client fails with the same error, on the next tick`,
|
|
7635
7851
|
rung: "implemented"
|
|
7636
7852
|
},
|
|
7637
7853
|
{
|
|
7638
|
-
ref: `${AT$
|
|
7854
|
+
ref: `${AT$6}/query.js:122-150 a query gives its error or its result to its callback, at the error or at the ReadyForQuery`,
|
|
7639
7855
|
rung: "implemented"
|
|
7640
7856
|
},
|
|
7641
7857
|
{
|
|
7642
|
-
ref: `${AT$
|
|
7858
|
+
ref: `${AT$6}/client.js:702-737 query_timeout: a Node timer for each query, 'Query read timeout'. The client sends no cancel, and it keeps the active query`,
|
|
7643
7859
|
rung: "implemented"
|
|
7644
7860
|
},
|
|
7645
7861
|
{
|
|
7646
|
-
ref: `${AT$
|
|
7862
|
+
ref: `${AT$6}/client.js:616-641 the next query goes only after a ReadyForQuery, :765-777 a query on an unqueryable or ended client fails at once`,
|
|
7647
7863
|
rung: "implemented"
|
|
7648
7864
|
},
|
|
7649
7865
|
{
|
|
7650
|
-
ref: `${AT$
|
|
7866
|
+
ref: `${AT$6}/client.js:799-836 end: a dead socket or an active query destroys the socket, else connection.js:217-227 sends Terminate and ends the socket`,
|
|
7651
7867
|
rung: "implemented"
|
|
7652
7868
|
},
|
|
7653
7869
|
{
|
|
7654
|
-
ref: `${AT$
|
|
7870
|
+
ref: `${AT$6}/client.js:543-572 getStartupConf: statement_timeout, lock_timeout and idle_in_transaction_session_timeout go to the server only when they are set`,
|
|
7655
7871
|
rung: "implemented"
|
|
7656
7872
|
},
|
|
7657
7873
|
{
|
|
@@ -10047,7 +10263,7 @@ const PGPOOL_SESSION = machineSchema.parse({
|
|
|
10047
10263
|
});
|
|
10048
10264
|
//#endregion
|
|
10049
10265
|
//#region src/pg/postgres-session.ts
|
|
10050
|
-
const AT$
|
|
10266
|
+
const AT$5 = "postgresql REL_17_11 src";
|
|
10051
10267
|
const DOC = "postgresql REL_17_11 doc/src/sgml";
|
|
10052
10268
|
/**
|
|
10053
10269
|
* This document is the hold of a PostgreSQL 17.11 backend on one client connection, over its TCP
|
|
@@ -10087,163 +10303,163 @@ const POSTGRES_SESSION = machineSchema.parse({
|
|
|
10087
10303
|
rung: "implemented"
|
|
10088
10304
|
},
|
|
10089
10305
|
{
|
|
10090
|
-
ref: `${AT$
|
|
10306
|
+
ref: `${AT$5}/backend/tcop/backend_startup.c:157-161 BackendInitialize calls pq_init in the backend, before the startup packet`,
|
|
10091
10307
|
rung: "implemented"
|
|
10092
10308
|
},
|
|
10093
10309
|
{
|
|
10094
|
-
ref: `${AT$
|
|
10310
|
+
ref: `${AT$5}/backend/libpq/pqcomm.c:793-817 AcceptConnection in the postmaster, :180 the Port starts at zeros, :195-220 TCP_NODELAY and SO_KEEPALIVE on each socket that is not AF_UNIX, a failure is FATAL, :264-274 then the four TCP GUCs, a failure is a LOG only`,
|
|
10095
10311
|
rung: "implemented"
|
|
10096
10312
|
},
|
|
10097
10313
|
{
|
|
10098
|
-
ref: `${AT$
|
|
10314
|
+
ref: `${AT$5}/backend/libpq/pqcomm.c:1663-1711 pq_setkeepalivesidle: no call at a value equal to the Port's, and 0 sets the value that getsockopt read first; :1748-1795, :1827-1870 and :1902-1945 the same for TCP_KEEPINTVL, TCP_KEEPCNT and TCP_USER_TIMEOUT`,
|
|
10099
10315
|
rung: "implemented"
|
|
10100
10316
|
},
|
|
10101
10317
|
{
|
|
10102
|
-
ref: `${AT$
|
|
10318
|
+
ref: `${AT$5}/backend/libpq/pqcomm.c:87-90 TCP_KEEPIDLE on Linux, :1947-2047 an assign hook sets the socket of the session at once, and a show hook reads the kernel`,
|
|
10103
10319
|
rung: "implemented"
|
|
10104
10320
|
},
|
|
10105
10321
|
{
|
|
10106
|
-
ref: `${AT$
|
|
10322
|
+
ref: `${AT$5}/backend/utils/misc/guc_tables.c:3452-3461 tcp_keepalives_idle 0 s, :3463-3472 tcp_keepalives_interval 0 s, :3485-3495 tcp_keepalives_count 0, :3587-3596 tcp_user_timeout 0 ms: each PGC_USERSET, 0 to INT_MAX, 0 is the system default`,
|
|
10107
10323
|
rung: "implemented"
|
|
10108
10324
|
},
|
|
10109
10325
|
{
|
|
10110
|
-
ref: `${AT$
|
|
10326
|
+
ref: `${AT$5}/backend/utils/misc/guc_tables.c:2611-2620 statement_timeout, :2622-2631 lock_timeout, :2633-2642 idle_in_transaction_session_timeout, :2644-2653 transaction_timeout, :2655-2664 idle_session_timeout: each 0 ms, 0 to INT_MAX, PGC_USERSET, 0 turns it off`,
|
|
10111
10327
|
rung: "implemented"
|
|
10112
10328
|
},
|
|
10113
10329
|
{
|
|
10114
|
-
ref: `${AT$
|
|
10330
|
+
ref: `${AT$5}/backend/utils/misc/guc_tables.c:2774-2783 authentication_timeout 60 s, 1 to 600, PGC_SIGHUP; :3632-3641 client_connection_check_interval 0 ms, 0 to INT_MAX, PGC_USERSET`,
|
|
10115
10331
|
rung: "implemented"
|
|
10116
10332
|
},
|
|
10117
10333
|
{
|
|
10118
|
-
ref: `${AT$
|
|
10334
|
+
ref: `${AT$5}/backend/storage/lmgr/proc.c:58-62, backend/tcop/postgres.c:106 and backend/postmaster/postmaster.c:228 the C defaults agree: 0 ms for each timeout, 0 ms for the client check, 60 s for authentication`,
|
|
10119
10335
|
rung: "implemented"
|
|
10120
10336
|
},
|
|
10121
10337
|
{
|
|
10122
|
-
ref: `${AT$
|
|
10338
|
+
ref: `${AT$5}/include/utils/timeout.h:3-4 and :23-43 one SIGALRM for each timeout id, STARTUP_PACKET_TIMEOUT to CLIENT_CONNECTION_CHECK_TIMEOUT`,
|
|
10123
10339
|
rung: "implemented"
|
|
10124
10340
|
},
|
|
10125
10341
|
{
|
|
10126
|
-
ref: `${AT$
|
|
10342
|
+
ref: `${AT$5}/backend/utils/misc/timeout.c:559-575 enable_timeout_after: the deadline is the current time + the delay in ms, :209-350 schedule_alarm: setitimer(ITIMER_REAL) for the nearest deadline, :363-453 handle_sig_alarm sets the latch and calls each handler that is due`,
|
|
10127
10343
|
rung: "implemented"
|
|
10128
10344
|
},
|
|
10129
10345
|
{
|
|
10130
|
-
ref: `${AT$
|
|
10346
|
+
ref: `${AT$5}/backend/utils/init/postinit.c:770-782 the handlers of a backend, :1374-1407 the statement timer sends SIGINT, or SIGTERM in authentication, and the lock timer sends SIGINT, :1409-1447 each other handler sets a flag and the latch`,
|
|
10131
10347
|
rung: "implemented"
|
|
10132
10348
|
},
|
|
10133
10349
|
{
|
|
10134
|
-
ref: `${AT$
|
|
10350
|
+
ref: `${AT$5}/backend/tcop/postgres.c:2999-3023 die (SIGTERM) sets ProcDiePending, :3029-3043 StatementCancelHandler (SIGINT) sets QueryCancelPending, :4292-4294 the two handlers`,
|
|
10135
10351
|
rung: "implemented"
|
|
10136
10352
|
},
|
|
10137
10353
|
{
|
|
10138
|
-
ref: `${AT$
|
|
10354
|
+
ref: `${AT$5}/backend/tcop/postgres.c:3271-3319 ProcessInterrupts acts on a die request first: FATAL 57014 "canceling authentication due to timeout" in authentication, else FATAL 57P01 "terminating connection due to administrator command"`,
|
|
10139
10355
|
rung: "implemented"
|
|
10140
10356
|
},
|
|
10141
10357
|
{
|
|
10142
|
-
ref: `${AT$
|
|
10358
|
+
ref: `${AT$5}/backend/tcop/postgres.c:3321-3350 then the client check, then a lost connection: FATAL 08006 "connection to client lost", with no message to the client`,
|
|
10143
10359
|
rung: "implemented"
|
|
10144
10360
|
},
|
|
10145
10361
|
{
|
|
10146
|
-
ref: `${AT$
|
|
10362
|
+
ref: `${AT$5}/backend/tcop/postgres.c:3372-3430 a cancel: ERROR 55P03 "canceling statement due to lock timeout", ERROR 57014 "canceling statement due to statement timeout"`,
|
|
10147
10363
|
rung: "implemented"
|
|
10148
10364
|
},
|
|
10149
10365
|
{
|
|
10150
|
-
ref: `${AT$
|
|
10366
|
+
ref: `${AT$5}/backend/tcop/postgres.c:3435-3477 FATAL 25P03 "terminating connection due to idle-in-transaction timeout", FATAL 25P04 "terminating connection due to transaction timeout", FATAL 57P05 "terminating connection due to idle-session timeout"`,
|
|
10151
10367
|
rung: "implemented"
|
|
10152
10368
|
},
|
|
10153
10369
|
{
|
|
10154
|
-
ref: `${AT$
|
|
10370
|
+
ref: `${AT$5}/backend/utils/errcodes.txt:106-107 08003 and 08006, :111 08P01, :254-255 25P03 and 25P04, :421 55P03, :428-429 57014 and 57P01, :433 57P05`,
|
|
10155
10371
|
rung: "implemented"
|
|
10156
10372
|
},
|
|
10157
10373
|
{
|
|
10158
|
-
ref: `${AT$
|
|
10374
|
+
ref: `${AT$5}/backend/tcop/postgres.c:4618-4706 at ReadyForQuery the backend arms idle_in_transaction_session_timeout in a transaction block, open or aborted, and idle_session_timeout outside one; :4714-4750 after a message it disarms them, then checks for interrupts`,
|
|
10159
10375
|
rung: "implemented"
|
|
10160
10376
|
},
|
|
10161
10377
|
{
|
|
10162
|
-
ref: `${AT$
|
|
10378
|
+
ref: `${AT$5}/backend/tcop/postgres.c:2770-2796 start_xact_command arms statement_timeout and the client check, each only when not active, :2798-2802 finish_xact_command disarms statement_timeout, :5251-5278 no statement timer when statement_timeout >= transaction_timeout > 0`,
|
|
10163
10379
|
rung: "implemented"
|
|
10164
10380
|
},
|
|
10165
10381
|
{
|
|
10166
|
-
ref: `${AT$
|
|
10382
|
+
ref: `${AT$5}/backend/utils/adt/misc.c:391-412 pg_sleep: CHECK_FOR_INTERRUPTS before each WaitLatch on the latch of the backend, thus the SIGALRM of a timeout ends its wait`,
|
|
10167
10383
|
rung: "implemented"
|
|
10168
10384
|
},
|
|
10169
10385
|
{
|
|
10170
|
-
ref: `${AT$
|
|
10386
|
+
ref: `${AT$5}/backend/tcop/postgres.c:4446-4502 an ERROR: disable_all_timeouts, the error to the client, AbortCurrentTransaction; :4562-4563 then ReadyForQuery`,
|
|
10171
10387
|
rung: "implemented"
|
|
10172
10388
|
},
|
|
10173
10389
|
{
|
|
10174
|
-
ref: `${AT$
|
|
10390
|
+
ref: `${AT$5}/backend/access/transam/xact.c:2174-2176 StartTransaction arms transaction_timeout, :2315-2317, :2592-2594 and :2768-2770 commit, prepare and abort disarm it, :3472-3477 an error in a transaction block aborts the transaction and keeps the block`,
|
|
10175
10391
|
rung: "implemented"
|
|
10176
10392
|
},
|
|
10177
10393
|
{
|
|
10178
|
-
ref: `${AT$
|
|
10394
|
+
ref: `${AT$5}/backend/storage/lmgr/proc.c:1292-1307 ProcSleep arms lock_timeout with the deadlock timer, :1652-1666 and disarms it after the wait`,
|
|
10179
10395
|
rung: "implemented"
|
|
10180
10396
|
},
|
|
10181
10397
|
{
|
|
10182
|
-
ref: `${AT$
|
|
10398
|
+
ref: `${AT$5}/backend/tcop/postgres.c:3652-3661 a client_connection_check_interval above 0 needs a wait set that reports a close`,
|
|
10183
10399
|
rung: "implemented"
|
|
10184
10400
|
},
|
|
10185
10401
|
{
|
|
10186
|
-
ref: `${AT$
|
|
10402
|
+
ref: `${AT$5}/backend/libpq/pqcomm.c:2049-2084 pq_check_connection: a wait of 0 ms for WL_SOCKET_CLOSED`,
|
|
10187
10403
|
rung: "implemented"
|
|
10188
10404
|
},
|
|
10189
10405
|
{
|
|
10190
|
-
ref: `${AT$
|
|
10406
|
+
ref: `${AT$5}/backend/storage/ipc/latch.c:72-85 epoll where sys/epoll.h exists, :1131-1156 WL_SOCKET_CLOSED adds EPOLLRDHUP, and EPOLLERR and EPOLLHUP are always on, :1661-1680 EPOLLERR or EPOLLHUP make the socket readable, writable and closed, :2253-2263 epoll can report a close`,
|
|
10191
10407
|
rung: "implemented"
|
|
10192
10408
|
},
|
|
10193
10409
|
{
|
|
10194
|
-
ref: `${AT$
|
|
10410
|
+
ref: `${AT$5}/backend/libpq/be-secure.c:174-261 secure_read and :300-370 secure_write: a wait for the socket or the latch with no timeout; at the latch, ProcessClientReadInterrupt or ProcessClientWriteInterrupt; :234-237 and :343-346 FATAL 57P01 at the death of the postmaster`,
|
|
10195
10411
|
rung: "implemented"
|
|
10196
10412
|
},
|
|
10197
10413
|
{
|
|
10198
|
-
ref: `${AT$
|
|
10414
|
+
ref: `${AT$5}/backend/tcop/postgres.c:513-548 ProcessClientReadInterrupt: each interrupt in the wait for a command, a die request in another read; :559-600 ProcessClientWriteInterrupt: a die request only, with no message to the client`,
|
|
10199
10415
|
rung: "implemented"
|
|
10200
10416
|
},
|
|
10201
10417
|
{
|
|
10202
|
-
ref: `${AT$
|
|
10418
|
+
ref: `${AT$5}/backend/libpq/pqcomm.c:287-297 the socket has O_NONBLOCK, and the latch gives the waits; :896-956 pq_recvbuf: 0 bytes or an error is EOF, and an error logs COMMERROR "could not receive data from client: %m"`,
|
|
10203
10419
|
rung: "implemented"
|
|
10204
10420
|
},
|
|
10205
10421
|
{
|
|
10206
|
-
ref: `${AT$
|
|
10422
|
+
ref: `${AT$5}/backend/tcop/postgres.c:364-396 SocketBackend: EOF in a transaction logs COMMERROR 08006 "unexpected EOF on client connection with an open transaction", else DEBUG1 08003; :4988-5016 EOF or Terminate: proc_exit(0)`,
|
|
10207
10423
|
rung: "implemented"
|
|
10208
10424
|
},
|
|
10209
10425
|
{
|
|
10210
|
-
ref: `${AT$
|
|
10426
|
+
ref: `${AT$5}/backend/access/transam/xact.c:383-396 IsTransactionState is TRANS_INPROGRESS only; backend/utils/init/postinit.c:1360-1371 ShutdownPostgres aborts the transaction at exit`,
|
|
10211
10427
|
rung: "implemented"
|
|
10212
10428
|
},
|
|
10213
10429
|
{
|
|
10214
|
-
ref: `${AT$
|
|
10430
|
+
ref: `${AT$5}/backend/libpq/pqcomm.c:1275-1336 a full buffer flushes, and the flush waits for the socket, :1358-1423 internal_flush_buffer: an error logs COMMERROR "could not send data to client: %m" once for each errno, drops the buffer and sets ClientConnectionLost`,
|
|
10215
10431
|
rung: "implemented"
|
|
10216
10432
|
},
|
|
10217
10433
|
{
|
|
10218
|
-
ref: `${AT$
|
|
10434
|
+
ref: `${AT$5}/backend/tcop/postgres.c:4310-4316 the backend ignores SIGPIPE`,
|
|
10219
10435
|
rung: "implemented"
|
|
10220
10436
|
},
|
|
10221
10437
|
{
|
|
10222
|
-
ref: `${AT$
|
|
10438
|
+
ref: `${AT$5}/include/utils/elog.h:31-38 COMMERROR is LOG_SERVER_ONLY; backend/utils/error/elog.c:205-228 it goes to the log at log_min_messages WARNING (guc_tables.c:534), and DEBUG1 does not`,
|
|
10223
10439
|
rung: "implemented"
|
|
10224
10440
|
},
|
|
10225
10441
|
{
|
|
10226
|
-
ref: `${AT$
|
|
10442
|
+
ref: `${AT$5}/backend/utils/error/elog.c:245-262 and :1726-1732 an error goes to the client while the output is DestRemote, :3643-3651 the backend flushes it, :559-590 FATAL ends the process with proc_exit(1)`,
|
|
10227
10443
|
rung: "implemented"
|
|
10228
10444
|
},
|
|
10229
10445
|
{
|
|
10230
|
-
ref: `${AT$
|
|
10446
|
+
ref: `${AT$5}/backend/libpq/pqcomm.c:347-392 socket_close keeps the socket open until the process exits`,
|
|
10231
10447
|
rung: "implemented"
|
|
10232
10448
|
},
|
|
10233
10449
|
{
|
|
10234
|
-
ref: `${AT$
|
|
10450
|
+
ref: `${AT$5}/backend/tcop/backend_startup.c:237-253 the startup timer: authentication_timeout, after the DNS lookup, :311-314 the end of the startup packet disarms it, :895-922 its handler and SIGTERM call _exit(1), with no log and no message`,
|
|
10235
10451
|
rung: "implemented"
|
|
10236
10452
|
},
|
|
10237
10453
|
{
|
|
10238
|
-
ref: `${AT$
|
|
10454
|
+
ref: `${AT$5}/backend/tcop/backend_startup.c:460-519 ProcessStartupPacket: no byte is a silent end, a part of a packet logs COMMERROR 08P01 "incomplete startup packet"; :328-333 proc_exit(0)`,
|
|
10239
10455
|
rung: "implemented"
|
|
10240
10456
|
},
|
|
10241
10457
|
{
|
|
10242
|
-
ref: `${AT$
|
|
10458
|
+
ref: `${AT$5}/backend/utils/init/postinit.c:235-251 PerformAuthentication arms the statement timer at authentication_timeout * 1000 ms, :305 ClientAuthInProgress ends after it, :1210-1215 the GUCs of the startup packet apply after it`,
|
|
10243
10459
|
rung: "implemented"
|
|
10244
10460
|
},
|
|
10245
10461
|
{
|
|
10246
|
-
ref: `${AT$
|
|
10462
|
+
ref: `${AT$5}/backend/libpq/auth.c:260-271 an EOF from the client in authentication: proc_exit(0), with no log; :714-744 recv_password_packet gives an EOF as NULL`,
|
|
10247
10463
|
rung: "implemented"
|
|
10248
10464
|
},
|
|
10249
10465
|
{
|
|
@@ -12272,7 +12488,7 @@ const PROCEDURES_WS_SERVER = machineSchema.parse({
|
|
|
12272
12488
|
});
|
|
12273
12489
|
//#endregion
|
|
12274
12490
|
//#region src/proxy/caddy.ts
|
|
12275
|
-
const AT$
|
|
12491
|
+
const AT$4 = "caddy v2.11.7";
|
|
12276
12492
|
const XNET = "x/net v0.59.0";
|
|
12277
12493
|
/**
|
|
12278
12494
|
* This document is Caddy 2.11.7 as an HTTP/2 proxy of gRPC, for one connection of a client. Its
|
|
@@ -12298,11 +12514,11 @@ const CADDY_HTTP2 = machineSchema.parse({
|
|
|
12298
12514
|
},
|
|
12299
12515
|
sources: [
|
|
12300
12516
|
{
|
|
12301
|
-
ref: `${AT$
|
|
12517
|
+
ref: `${AT$4} modules/caddyhttp/app.go:404-418, :925-940 the defaults of a server: idle_timeout 5 min, read_header_timeout 1 min, read_idle_timeout 1 min, write_idle_timeout 1 min`,
|
|
12302
12518
|
rung: "implemented"
|
|
12303
12519
|
},
|
|
12304
12520
|
{
|
|
12305
|
-
ref: `${AT$
|
|
12521
|
+
ref: `${AT$4} modules/caddyhttp/app.go:520-533 the protocol h2c: http2.ConfigureServer with a zero http2.Server of ${XNET}`,
|
|
12306
12522
|
rung: "implemented"
|
|
12307
12523
|
},
|
|
12308
12524
|
{
|
|
@@ -12322,15 +12538,15 @@ const CADDY_HTTP2 = machineSchema.parse({
|
|
|
12322
12538
|
rung: "implemented"
|
|
12323
12539
|
},
|
|
12324
12540
|
{
|
|
12325
|
-
ref: `${AT$
|
|
12541
|
+
ref: `${AT$4} modules/caddyhttp/reverseproxy/reverseproxy.go:1086, :1107-1112, :1393-1397, :1667-1697 a failure of the upstream before the headers of a response: no retry at the defaults, and statusError gives 502`,
|
|
12326
12542
|
rung: "implemented"
|
|
12327
12543
|
},
|
|
12328
12544
|
{
|
|
12329
|
-
ref: `${AT$
|
|
12545
|
+
ref: `${AT$4} modules/caddyhttp/reverseproxy/reverseproxy.go:1331-1352 and ${XNET} xs:2296-2310 after the headers, a failed copy panics with http.ErrAbortHandler, and the stream gets RST_STREAM INTERNAL_ERROR`,
|
|
12330
12546
|
rung: "implemented"
|
|
12331
12547
|
},
|
|
12332
12548
|
{
|
|
12333
|
-
ref: `${AT$
|
|
12549
|
+
ref: `${AT$4} modules/caddyhttp/reverseproxy/httptransport.go:212-226 the defaults of the transport: a dial timeout of 3 s, and an idle upstream connection closes after 2 min`,
|
|
12334
12550
|
rung: "implemented"
|
|
12335
12551
|
},
|
|
12336
12552
|
{
|
|
@@ -12338,11 +12554,11 @@ const CADDY_HTTP2 = machineSchema.parse({
|
|
|
12338
12554
|
rung: "implemented"
|
|
12339
12555
|
},
|
|
12340
12556
|
{
|
|
12341
|
-
ref: `${AT$
|
|
12557
|
+
ref: `${AT$4} modules/caddyhttp/app.go:136-142, :753-799, :862-876 a stop calls Shutdown on each server: a GOAWAY at once, and the grace period is eternal at the defaults. Caddy closes no connection by itself`,
|
|
12342
12558
|
rung: "implemented"
|
|
12343
12559
|
},
|
|
12344
12560
|
{
|
|
12345
|
-
ref: `${AT$
|
|
12561
|
+
ref: `${AT$4} modules/caddyhttp/app.go:570-577 and go1.26.8 src/net/tcpsock.go:291-296 each accepted socket gets the TCP keepalive of Go: 15 s, 15 s and 9 probes`,
|
|
12346
12562
|
rung: "implemented"
|
|
12347
12563
|
}
|
|
12348
12564
|
],
|
|
@@ -12633,7 +12849,7 @@ const CADDY_HTTP2 = machineSchema.parse({
|
|
|
12633
12849
|
});
|
|
12634
12850
|
//#endregion
|
|
12635
12851
|
//#region src/proxy/envoy.ts
|
|
12636
|
-
const AT$
|
|
12852
|
+
const AT$3 = "envoy v1.39.4";
|
|
12637
12853
|
/**
|
|
12638
12854
|
* This document is Envoy 1.39.4 as an HTTP/2 proxy of gRPC, for one connection of a client. Its static
|
|
12639
12855
|
* configuration is the one of the harness. It has one listener with the HTTP connection manager, one
|
|
@@ -12658,67 +12874,67 @@ const ENVOY_HTTP2 = machineSchema.parse({
|
|
|
12658
12874
|
},
|
|
12659
12875
|
sources: [
|
|
12660
12876
|
{
|
|
12661
|
-
ref: `${AT$
|
|
12877
|
+
ref: `${AT$3} source/common/runtime/runtime_features.cc:274-276 the codec of HTTP/2 is nghttp2: http2_use_oghttp2 is false`,
|
|
12662
12878
|
rung: "implemented"
|
|
12663
12879
|
},
|
|
12664
12880
|
{
|
|
12665
|
-
ref: `${AT$
|
|
12881
|
+
ref: `${AT$3} hutil.cc:746-777, :805-808 a local reply to a gRPC request is a response of trailers only: :status 200, grpc-status and grpc-message`,
|
|
12666
12882
|
rung: "implemented"
|
|
12667
12883
|
},
|
|
12668
12884
|
{
|
|
12669
|
-
ref: `${AT$
|
|
12885
|
+
ref: `${AT$3} source/common/grpc/status.cc:6-26 the status of an HTTP code: 429, 502, 503 and 504 give UNAVAILABLE, and an unknown code gives UNKNOWN`,
|
|
12670
12886
|
rung: "implemented"
|
|
12671
12887
|
},
|
|
12672
12888
|
{
|
|
12673
|
-
ref: `${AT$
|
|
12889
|
+
ref: `${AT$3} source/common/http/filter_manager.cc:1120-1127, cm.cc:301-313 and h2.cc:193-199 after the headers of the response, a local reply resets the stream with INTERNAL_ERROR`,
|
|
12674
12890
|
rung: "implemented"
|
|
12675
12891
|
},
|
|
12676
12892
|
{
|
|
12677
|
-
ref: `${AT$
|
|
12893
|
+
ref: `${AT$3} api/envoy/config/route/v3/route_components.proto:1373-1384 and source/common/router/config_impl.h:976 the timeout of a route: 15 s when it is not given`,
|
|
12678
12894
|
rung: "implemented"
|
|
12679
12895
|
},
|
|
12680
12896
|
{
|
|
12681
|
-
ref: `${AT$
|
|
12897
|
+
ref: `${AT$3} router.cc:180-266, :1309-1331, :1530-1572 the timer of the route starts at the end of the request, and its end gives the local reply 504 "upstream request timeout". The flag grpc_timeout_returns_deadline_exceeded is false (runtime_features.cc:242-244)`,
|
|
12682
12898
|
rung: "implemented"
|
|
12683
12899
|
},
|
|
12684
12900
|
{
|
|
12685
|
-
ref: `${AT$
|
|
12901
|
+
ref: `${AT$3} route_components.proto:1114-1118 and cm.cc:1731-1772 Envoy reads grpc-timeout only with grpc_timeout_header_max. At the defaults it forwards the header and does not act on it`,
|
|
12686
12902
|
rung: "implemented"
|
|
12687
12903
|
},
|
|
12688
12904
|
{
|
|
12689
|
-
ref: `${AT$
|
|
12905
|
+
ref: `${AT$3} source/common/http/codec_client.cc:124-144 and router.cc:1574-1581, :1681-1712 a reset of the upstream connection resets each stream on it with ConnectionTermination. With no retry policy, the router sends the local reply 503 "upstream connect error or disconnect/reset before headers. reset reason: connection termination"`,
|
|
12690
12906
|
rung: "implemented"
|
|
12691
12907
|
},
|
|
12692
12908
|
{
|
|
12693
|
-
ref: `${AT$
|
|
12909
|
+
ref: `${AT$3} source/common/router/retry_state_impl.cc:28-47 a route with no retry_on, and a request with no x-envoy-retry-on, get no retry state`,
|
|
12694
12910
|
rung: "implemented"
|
|
12695
12911
|
},
|
|
12696
12912
|
{
|
|
12697
|
-
ref: `${AT$
|
|
12913
|
+
ref: `${AT$3} source/common/upstream/upstream_impl.cc:1206-1207 the connect timeout of a cluster: 5 s. Its end gives the local reply 503 with the reset reason connection timeout`,
|
|
12698
12914
|
rung: "implemented"
|
|
12699
12915
|
},
|
|
12700
12916
|
{
|
|
12701
|
-
ref: `${AT$
|
|
12917
|
+
ref: `${AT$3} source/extensions/filters/network/http_connection_manager/config.h:372-377 and config.cc:404-425, :488-492 the defaults of the HTTP connection manager: stream_idle_timeout 5 min, request_timeout off, drain_timeout 5 s, delayed_close_timeout 1 s, idle_timeout 1 h`,
|
|
12702
12918
|
rung: "implemented"
|
|
12703
12919
|
},
|
|
12704
12920
|
{
|
|
12705
|
-
ref: `${AT$
|
|
12921
|
+
ref: `${AT$3} cm.cc:968-974, :1052-1069 the idle timer of a stream: each frame of the stream arms it again. Its end gives the local reply 504 "stream timeout" for a request that is complete`,
|
|
12706
12922
|
rung: "implemented"
|
|
12707
12923
|
},
|
|
12708
12924
|
{
|
|
12709
|
-
ref: `${AT$
|
|
12925
|
+
ref: `${AT$3} cm.cc:207-212, :1699-1705, :819-824 and h2.cc:1176-1193 the idle timer of a connection runs only with no stream open. Its end sends GOAWAY NO_ERROR as a notice, then after drain_timeout the final GOAWAY and the close`,
|
|
12710
12926
|
rung: "implemented"
|
|
12711
12927
|
},
|
|
12712
12928
|
{
|
|
12713
|
-
ref: `${AT$
|
|
12929
|
+
ref: `${AT$3} api/envoy/config/core/v3/protocol.proto:538-569 and h2.cc:1013-1029 no PING of HTTP/2 from Envoy when connection_keepalive is not given`,
|
|
12714
12930
|
rung: "implemented"
|
|
12715
12931
|
},
|
|
12716
12932
|
{
|
|
12717
|
-
ref: `${AT$
|
|
12933
|
+
ref: `${AT$3} source/common/listener_manager/listener_impl.cc:405-416 and upstream_impl.cc:223-228 no SO_KEEPALIVE on a socket when tcp_keepalive is not given. No TCP_USER_TIMEOUT anywhere`,
|
|
12718
12934
|
rung: "implemented"
|
|
12719
12935
|
},
|
|
12720
12936
|
{
|
|
12721
|
-
ref: `${AT$
|
|
12937
|
+
ref: `${AT$3} source/server/server.cc:1005-1014, :1097-1127 and source/common/listener_manager/active_tcp_listener.cc:54-63 SIGTERM shuts down the server: each worker closes each connection with NoFlush. No GOAWAY and no timer of the drain`,
|
|
12722
12938
|
rung: "implemented"
|
|
12723
12939
|
}
|
|
12724
12940
|
],
|
|
@@ -13078,6 +13294,394 @@ const ENVOY_HTTP2 = machineSchema.parse({
|
|
|
13078
13294
|
}
|
|
13079
13295
|
});
|
|
13080
13296
|
//#endregion
|
|
13297
|
+
//#region src/proxy/nginx.ts
|
|
13298
|
+
const AT$2 = "nginx release-1.29.6";
|
|
13299
|
+
const V2 = "src/http/v2/ngx_http_v2.c";
|
|
13300
|
+
const UP = "src/http/ngx_http_upstream.c";
|
|
13301
|
+
/**
|
|
13302
|
+
* This document is nginx 1.29.6 as an HTTP/2 proxy of gRPC, for one connection of a client. Its
|
|
13303
|
+
* configuration is the one of the harness: one worker (the default), one server of h2c, and `grpc_pass`
|
|
13304
|
+
* to one address with no `upstream {}` block. Each other directive is at its built-in default, not at the
|
|
13305
|
+
* values of the stock nginx.conf (keepalive_timeout 65 and worker_processes auto).
|
|
13306
|
+
*
|
|
13307
|
+
* - With no stream open for 75 s (keepalive_timeout), nginx sends GOAWAY NO_ERROR, then a FIN, and it
|
|
13308
|
+
* reads and drops the input for at most 30 s (the lingering close). A PING does not reset that timer.
|
|
13309
|
+
* - While a stream is open, the connection of the client has no timer. The only timer of a call is
|
|
13310
|
+
* grpc_read_timeout (60 s) on the upstream socket, from the send of the request. When it fires before
|
|
13311
|
+
* the headers of the response, the client gets 504 with no gRPC status, thus UNAVAILABLE. After them,
|
|
13312
|
+
* RST_STREAM INTERNAL_ERROR. nginx does not retry a call that it sent.
|
|
13313
|
+
* - Each call has its own upstream connection, which ends with the call.
|
|
13314
|
+
* - A stopped worker: the timers that came due during the stop fire at the resume. They read one clock,
|
|
13315
|
+
* which nginx reads after each wait of epoll_wait. After a stop and a continue, that wait fails with
|
|
13316
|
+
* EINTR (signal(7)). Then nginx fires its timers before it reads any I/O. Thus a stop longer than
|
|
13317
|
+
* grpc_read_timeout gives 504, also when the reply of the server waits in the socket.
|
|
13318
|
+
* - SIGQUIT and SIGHUP send GOAWAY NO_ERROR, and the worker waits for each stream. SIGTERM exits with
|
|
13319
|
+
* no GOAWAY.
|
|
13320
|
+
*/
|
|
13321
|
+
const NGINX_GRPC = machineSchema.parse({
|
|
13322
|
+
format: "mark1russell7.machine/1",
|
|
13323
|
+
id: "nginx-grpc",
|
|
13324
|
+
title: "nginx 1.29.6 as an HTTP/2 proxy of gRPC: one connection of a client, its idle close, the read timer of a call, and a stopped worker",
|
|
13325
|
+
layer: "proxy",
|
|
13326
|
+
version: "1.29.6",
|
|
13327
|
+
conditions: {
|
|
13328
|
+
nginx: "release-1.29.6 (the system nginx-pre-1.29.7)",
|
|
13329
|
+
configuration: "one worker, listen with http2 on, grpc_pass to one address with no upstream {} block, each directive at its built-in default"
|
|
13330
|
+
},
|
|
13331
|
+
sources: [
|
|
13332
|
+
{
|
|
13333
|
+
ref: `${AT$2} src/http/ngx_http_core_module.c:3540-3541, :3844-3845, :3885, :3894-3909 the defaults: client_header_timeout, client_body_timeout and send_timeout 60 s, keepalive_timeout 75 s, keepalive_time 1 h, lingering_time 30 s, lingering_timeout 5 s`,
|
|
13334
|
+
rung: "implemented"
|
|
13335
|
+
},
|
|
13336
|
+
{
|
|
13337
|
+
ref: `${AT$2} src/http/modules/ngx_http_grpc_module.c:4462-4469 grpc_connect_timeout, grpc_send_timeout and grpc_read_timeout: 60 s each`,
|
|
13338
|
+
rung: "implemented"
|
|
13339
|
+
},
|
|
13340
|
+
{
|
|
13341
|
+
ref: `${AT$2} ${V2}:3102-3104 a new stream deletes the read timer of the connection, and :668-670 the end of the last stream arms keepalive_timeout`,
|
|
13342
|
+
rung: "implemented"
|
|
13343
|
+
},
|
|
13344
|
+
{
|
|
13345
|
+
ref: `${AT$2} ${V2}:4694-4697, :4764-4769, :703-775 the idle timer sends GOAWAY NO_ERROR, then the lingering close: a FIN, and the input is dropped`,
|
|
13346
|
+
rung: "implemented"
|
|
13347
|
+
},
|
|
13348
|
+
{
|
|
13349
|
+
ref: `${AT$2} ${V2}:2325-2336 a PING of the client gets its ACK, and no timer moves`,
|
|
13350
|
+
rung: "implemented"
|
|
13351
|
+
},
|
|
13352
|
+
{
|
|
13353
|
+
ref: `${AT$2} ${UP}:2242-2249 the read timer arms when the request has gone to the upstream, and :4046-4051 it arms again after each read of the response`,
|
|
13354
|
+
rung: "implemented"
|
|
13355
|
+
},
|
|
13356
|
+
{
|
|
13357
|
+
ref: `${AT$2} ${UP}:2452-2454, :4606-4621, :4668-4672, :4879-4884 a read timeout before the headers of the response: no retry, then 504 (src/http/ngx_http_special_response.c:316-321), with no grpc-status`,
|
|
13358
|
+
rung: "implemented"
|
|
13359
|
+
},
|
|
13360
|
+
{
|
|
13361
|
+
ref: `${AT$2} ${UP}:3912-3915 and ${V2}:4521-4531 a read timeout after the headers: RST_STREAM INTERNAL_ERROR`,
|
|
13362
|
+
rung: "implemented"
|
|
13363
|
+
},
|
|
13364
|
+
{
|
|
13365
|
+
ref: `${AT$2} src/http/modules/ngx_http_grpc_module.c:4859 and ${UP}:6806-6816 grpc_pass to an address is an implicit upstream with no keepalive: each call has its own upstream connection, and ${UP}:4793-4822 it ends with the call`,
|
|
13366
|
+
rung: "implemented"
|
|
13367
|
+
},
|
|
13368
|
+
{
|
|
13369
|
+
ref: `${AT$2} src/core/nginx.c:1148 worker_processes is 1, and src/event/ngx_event.c:649-656 with :1369 no accept mutex: the handlers of I/O run in the processing of epoll_wait`,
|
|
13370
|
+
rung: "implemented"
|
|
13371
|
+
},
|
|
13372
|
+
{
|
|
13373
|
+
ref: `${AT$2} src/event/modules/ngx_epoll_module.c:804-823 the clock updates after epoll_wait, and an error of it (EINTR) returns before any event; src/event/ngx_event.c:248-263 then the timers fire; src/event/ngx_event_timer.c:53-96 each overdue timer, the earliest first`,
|
|
13374
|
+
rung: "implemented"
|
|
13375
|
+
},
|
|
13376
|
+
{
|
|
13377
|
+
ref: "signal(7): epoll_wait fails with EINTR after a stop signal and SIGCONT, also with no handler",
|
|
13378
|
+
rung: "documented"
|
|
13379
|
+
},
|
|
13380
|
+
{
|
|
13381
|
+
ref: `${AT$2} src/os/unix/ngx_process_cycle.c:203-244, :712-740 and src/core/ngx_connection.c:1433-1450 SIGQUIT and SIGHUP: GOAWAY NO_ERROR, and the worker waits for each stream; :723-726 SIGTERM: no GOAWAY`,
|
|
13382
|
+
rung: "implemented"
|
|
13383
|
+
}
|
|
13384
|
+
],
|
|
13385
|
+
states: {
|
|
13386
|
+
"[none]": {
|
|
13387
|
+
initial: true,
|
|
13388
|
+
pseudo: true,
|
|
13389
|
+
note: "Before the accept of the connection of the client"
|
|
13390
|
+
},
|
|
13391
|
+
idle: { note: "The connection of the client, with no stream open. keepalive_timeout runs, or client_header_timeout before the first stream" },
|
|
13392
|
+
active: { note: "A stream is open. The connection has no timer, and the call has the read timer of its upstream socket" },
|
|
13393
|
+
stopped: { note: "The worker is stopped while a call is open. The kernel keeps each socket, and the reply of the server waits in its queue" },
|
|
13394
|
+
lingering: { note: "After the GOAWAY and the FIN: nginx drops the input until the lingering close ends" },
|
|
13395
|
+
ended: {
|
|
13396
|
+
final: true,
|
|
13397
|
+
note: "The connection of the client closed"
|
|
13398
|
+
}
|
|
13399
|
+
},
|
|
13400
|
+
events: {
|
|
13401
|
+
"local.accept": {
|
|
13402
|
+
kind: "local",
|
|
13403
|
+
note: "The worker accepts the connection of the client"
|
|
13404
|
+
},
|
|
13405
|
+
"rx.headers": {
|
|
13406
|
+
kind: "rx",
|
|
13407
|
+
note: "The headers of a new stream: a call. Its request goes to the upstream on a new connection"
|
|
13408
|
+
},
|
|
13409
|
+
"upstream.end": {
|
|
13410
|
+
kind: "local",
|
|
13411
|
+
note: "The response of the upstream ends with its trailers: the stream closes"
|
|
13412
|
+
},
|
|
13413
|
+
"timer.idle": {
|
|
13414
|
+
kind: "timer",
|
|
13415
|
+
note: "No stream open for keepalive_timeout"
|
|
13416
|
+
},
|
|
13417
|
+
"timer.upstream-read": {
|
|
13418
|
+
kind: "timer",
|
|
13419
|
+
note: "No read of the upstream socket for grpc_read_timeout"
|
|
13420
|
+
},
|
|
13421
|
+
"timer.lingering": {
|
|
13422
|
+
kind: "timer",
|
|
13423
|
+
note: "lingering_timeout with no input, or lingering_time in all"
|
|
13424
|
+
},
|
|
13425
|
+
"app.stop": {
|
|
13426
|
+
kind: "app",
|
|
13427
|
+
note: "SIGSTOP to the processes of nginx"
|
|
13428
|
+
},
|
|
13429
|
+
"app.cont": {
|
|
13430
|
+
kind: "app",
|
|
13431
|
+
note: "SIGCONT: the worker runs again"
|
|
13432
|
+
},
|
|
13433
|
+
"app.quit": {
|
|
13434
|
+
kind: "app",
|
|
13435
|
+
note: "SIGQUIT, or SIGHUP to the master, which sends SIGQUIT to the old worker"
|
|
13436
|
+
},
|
|
13437
|
+
"peer.fin": {
|
|
13438
|
+
kind: "peer",
|
|
13439
|
+
note: "The client ends the connection"
|
|
13440
|
+
},
|
|
13441
|
+
"peer.rst": {
|
|
13442
|
+
kind: "peer",
|
|
13443
|
+
note: "A reset of the connection of the client"
|
|
13444
|
+
},
|
|
13445
|
+
"tx.status": {
|
|
13446
|
+
kind: "tx",
|
|
13447
|
+
note: "504 with an HTML body and no grpc-status, before the headers of a response"
|
|
13448
|
+
},
|
|
13449
|
+
"tx.rst-stream": {
|
|
13450
|
+
kind: "tx",
|
|
13451
|
+
note: "RST_STREAM INTERNAL_ERROR of a stream whose response headers went out"
|
|
13452
|
+
},
|
|
13453
|
+
"tx.goaway": {
|
|
13454
|
+
kind: "tx",
|
|
13455
|
+
note: "A GOAWAY NO_ERROR to the client"
|
|
13456
|
+
},
|
|
13457
|
+
"tx.fin": {
|
|
13458
|
+
kind: "tx",
|
|
13459
|
+
note: "The FIN of the lingering close"
|
|
13460
|
+
}
|
|
13461
|
+
},
|
|
13462
|
+
knobs: {
|
|
13463
|
+
keepalive_timeout: {
|
|
13464
|
+
key: "keepalive_timeout",
|
|
13465
|
+
scope: "server",
|
|
13466
|
+
unit: "s",
|
|
13467
|
+
default: 75,
|
|
13468
|
+
note: "ngx_http_core_module.c:3896-3897. The stock nginx.conf sets 65"
|
|
13469
|
+
},
|
|
13470
|
+
client_header_timeout: {
|
|
13471
|
+
key: "client_header_timeout",
|
|
13472
|
+
scope: "server",
|
|
13473
|
+
unit: "s",
|
|
13474
|
+
default: 60,
|
|
13475
|
+
note: "ngx_http_core_module.c:3540-3541: the timer of a connection before its first stream"
|
|
13476
|
+
},
|
|
13477
|
+
grpc_read_timeout: {
|
|
13478
|
+
key: "grpc_read_timeout",
|
|
13479
|
+
scope: "location",
|
|
13480
|
+
unit: "s",
|
|
13481
|
+
default: 60,
|
|
13482
|
+
note: "ngx_http_grpc_module.c:4468-4469"
|
|
13483
|
+
},
|
|
13484
|
+
lingering_timeout: {
|
|
13485
|
+
key: "lingering_timeout",
|
|
13486
|
+
scope: "server",
|
|
13487
|
+
unit: "s",
|
|
13488
|
+
default: 5,
|
|
13489
|
+
note: "ngx_http_core_module.c:3908-3909"
|
|
13490
|
+
},
|
|
13491
|
+
lingering_time: {
|
|
13492
|
+
key: "lingering_time",
|
|
13493
|
+
scope: "server",
|
|
13494
|
+
unit: "s",
|
|
13495
|
+
default: 30,
|
|
13496
|
+
note: "ngx_http_core_module.c:3906-3907"
|
|
13497
|
+
},
|
|
13498
|
+
slack: {
|
|
13499
|
+
key: "the time of nginx for one step of its loop",
|
|
13500
|
+
scope: "process",
|
|
13501
|
+
unit: "s",
|
|
13502
|
+
default: .01,
|
|
13503
|
+
note: "An assumption of this document, not a value of nginx"
|
|
13504
|
+
}
|
|
13505
|
+
},
|
|
13506
|
+
timers: {
|
|
13507
|
+
idle: {
|
|
13508
|
+
duration: {
|
|
13509
|
+
knob: "keepalive_timeout",
|
|
13510
|
+
unit: "s"
|
|
13511
|
+
},
|
|
13512
|
+
lateness: {
|
|
13513
|
+
knob: "slack",
|
|
13514
|
+
unit: "s"
|
|
13515
|
+
},
|
|
13516
|
+
arms: ["enter:idle"],
|
|
13517
|
+
cancels: ["rx.headers"],
|
|
13518
|
+
fires: "timer.idle",
|
|
13519
|
+
note: "From the end of the last stream (ngx_http_v2.c:668-670). A PING does not arm it again"
|
|
13520
|
+
},
|
|
13521
|
+
upstream_read: {
|
|
13522
|
+
duration: {
|
|
13523
|
+
knob: "grpc_read_timeout",
|
|
13524
|
+
unit: "s"
|
|
13525
|
+
},
|
|
13526
|
+
lateness: {
|
|
13527
|
+
knob: "slack",
|
|
13528
|
+
unit: "s"
|
|
13529
|
+
},
|
|
13530
|
+
arms: ["rx.headers"],
|
|
13531
|
+
cancels: ["upstream.end"],
|
|
13532
|
+
fires: "timer.upstream-read",
|
|
13533
|
+
note: "From the send of the request to the upstream, and again after each read of the response (ngx_http_upstream.c:2242-2249, :4046-4051). In a stopped worker it comes due on the clock, and it fires at the resume"
|
|
13534
|
+
},
|
|
13535
|
+
lingering: {
|
|
13536
|
+
duration: {
|
|
13537
|
+
knob: "lingering_timeout",
|
|
13538
|
+
unit: "s"
|
|
13539
|
+
},
|
|
13540
|
+
lateness: {
|
|
13541
|
+
knob: "slack",
|
|
13542
|
+
unit: "s"
|
|
13543
|
+
},
|
|
13544
|
+
arms: ["tx.fin"],
|
|
13545
|
+
fires: "timer.lingering",
|
|
13546
|
+
note: "The close of the socket when no input comes for lingering_timeout. lingering_time bounds the whole close"
|
|
13547
|
+
}
|
|
13548
|
+
},
|
|
13549
|
+
transitions: [
|
|
13550
|
+
{
|
|
13551
|
+
id: "ng.accept",
|
|
13552
|
+
from: "[none]",
|
|
13553
|
+
to: "idle",
|
|
13554
|
+
on: "local.accept",
|
|
13555
|
+
timer: "idle",
|
|
13556
|
+
source: "src/http/ngx_http_request.c:356"
|
|
13557
|
+
},
|
|
13558
|
+
{
|
|
13559
|
+
id: "ng.stream",
|
|
13560
|
+
from: "idle",
|
|
13561
|
+
to: "active",
|
|
13562
|
+
on: "rx.headers",
|
|
13563
|
+
timer: "upstream_read",
|
|
13564
|
+
source: "ngx_http_v2.c:3102-3104"
|
|
13565
|
+
},
|
|
13566
|
+
{
|
|
13567
|
+
id: "ng.replied",
|
|
13568
|
+
from: "active",
|
|
13569
|
+
to: "idle",
|
|
13570
|
+
on: "upstream.end",
|
|
13571
|
+
timer: "idle",
|
|
13572
|
+
note: "The status of the upstream passes to the client in its trailers",
|
|
13573
|
+
source: "ngx_http_v2.c:4594-4603, :668-670"
|
|
13574
|
+
},
|
|
13575
|
+
{
|
|
13576
|
+
id: "ng.read-timeout",
|
|
13577
|
+
from: "active",
|
|
13578
|
+
to: "idle",
|
|
13579
|
+
on: "timer.upstream-read",
|
|
13580
|
+
timer: "upstream_read",
|
|
13581
|
+
guard: "no headers of the response went to the client",
|
|
13582
|
+
errno: "UNAVAILABLE",
|
|
13583
|
+
emits: ["tx.status"],
|
|
13584
|
+
note: "504 with no grpc-status, thus UNAVAILABLE Received HTTP status code 504. No retry",
|
|
13585
|
+
source: "ngx_http_upstream.c:2452-2454, :4606-4621, :4668-4672"
|
|
13586
|
+
},
|
|
13587
|
+
{
|
|
13588
|
+
id: "ng.read-timeout-streaming",
|
|
13589
|
+
from: "active",
|
|
13590
|
+
to: "idle",
|
|
13591
|
+
on: "timer.upstream-read",
|
|
13592
|
+
timer: "upstream_read",
|
|
13593
|
+
guard: "the headers of the response went to the client",
|
|
13594
|
+
errno: "INTERNAL",
|
|
13595
|
+
emits: ["tx.rst-stream"],
|
|
13596
|
+
source: "ngx_http_upstream.c:3912-3915, ngx_http_v2.c:4521-4531"
|
|
13597
|
+
},
|
|
13598
|
+
{
|
|
13599
|
+
id: "ng.stop",
|
|
13600
|
+
from: "active",
|
|
13601
|
+
to: "stopped",
|
|
13602
|
+
on: "app.stop",
|
|
13603
|
+
note: "The kernel keeps the sockets: ACKs go on, and the reply of the server waits in the queue of the upstream socket"
|
|
13604
|
+
},
|
|
13605
|
+
{
|
|
13606
|
+
id: "ng.resume-timeout",
|
|
13607
|
+
from: "stopped",
|
|
13608
|
+
to: "idle",
|
|
13609
|
+
on: "app.cont",
|
|
13610
|
+
guard: "the read timer came due during the stop, and no headers of the response went out",
|
|
13611
|
+
errno: "UNAVAILABLE",
|
|
13612
|
+
emits: ["tx.status"],
|
|
13613
|
+
note: "epoll_wait gives EINTR at the resume, thus each overdue timer fires before nginx reads the reply in the socket: 504, and the reply is dropped",
|
|
13614
|
+
source: "ngx_epoll_module.c:804-823, ngx_event.c:248-263, ngx_event_timer.c:53-96"
|
|
13615
|
+
},
|
|
13616
|
+
{
|
|
13617
|
+
id: "ng.resume",
|
|
13618
|
+
from: "stopped",
|
|
13619
|
+
to: "active",
|
|
13620
|
+
on: "app.cont",
|
|
13621
|
+
guard: "the read timer did not come due during the stop",
|
|
13622
|
+
note: "The reply in the socket goes to the client, late by the stop"
|
|
13623
|
+
},
|
|
13624
|
+
{
|
|
13625
|
+
id: "ng.idle",
|
|
13626
|
+
from: "idle",
|
|
13627
|
+
to: "lingering",
|
|
13628
|
+
on: "timer.idle",
|
|
13629
|
+
timer: "idle",
|
|
13630
|
+
emits: ["tx.goaway", "tx.fin"],
|
|
13631
|
+
note: "GOAWAY NO_ERROR with the last stream, then shutdown(SHUT_WR)",
|
|
13632
|
+
source: "ngx_http_v2.c:4694-4697, :4764-4769, :760-765"
|
|
13633
|
+
},
|
|
13634
|
+
{
|
|
13635
|
+
id: "ng.quit-idle",
|
|
13636
|
+
from: "idle",
|
|
13637
|
+
to: "lingering",
|
|
13638
|
+
on: "app.quit",
|
|
13639
|
+
emits: ["tx.goaway", "tx.fin"],
|
|
13640
|
+
source: "ngx_connection.c:1433-1450, ngx_http_v2.c:4694-4697"
|
|
13641
|
+
},
|
|
13642
|
+
{
|
|
13643
|
+
id: "ng.quit-active",
|
|
13644
|
+
from: "active",
|
|
13645
|
+
to: "active",
|
|
13646
|
+
on: "app.quit",
|
|
13647
|
+
emits: ["tx.goaway"],
|
|
13648
|
+
note: "The stream goes on, and later HEADERS are dropped. The worker waits for it, with no limit at the defaults",
|
|
13649
|
+
source: "ngx_http_v2.c:358-390, :1204-1208"
|
|
13650
|
+
},
|
|
13651
|
+
{
|
|
13652
|
+
id: "ng.lingered",
|
|
13653
|
+
from: "lingering",
|
|
13654
|
+
to: "ended",
|
|
13655
|
+
on: [
|
|
13656
|
+
"timer.lingering",
|
|
13657
|
+
"peer.fin",
|
|
13658
|
+
"peer.rst"
|
|
13659
|
+
],
|
|
13660
|
+
timer: "lingering",
|
|
13661
|
+
source: "ngx_http_v2.c:794-817"
|
|
13662
|
+
},
|
|
13663
|
+
{
|
|
13664
|
+
id: "ng.client-end",
|
|
13665
|
+
from: ["idle", "active"],
|
|
13666
|
+
to: "ended",
|
|
13667
|
+
on: ["peer.fin", "peer.rst"],
|
|
13668
|
+
source: "ngx_http_v2.c:4786-4815"
|
|
13669
|
+
}
|
|
13670
|
+
],
|
|
13671
|
+
over: {
|
|
13672
|
+
machine: "systems.machine.linux-tcp",
|
|
13673
|
+
states: {
|
|
13674
|
+
idle: "ESTABLISHED",
|
|
13675
|
+
active: "ESTABLISHED",
|
|
13676
|
+
stopped: "ESTABLISHED",
|
|
13677
|
+
lingering: "FIN_WAIT2"
|
|
13678
|
+
},
|
|
13679
|
+
sets: {},
|
|
13680
|
+
ends: "peer.rst",
|
|
13681
|
+
note: "The socket toward the client: a Linux TCP socket with no keepalive (so_keepalive is off at the defaults). The lingering close sends a FIN with shutdown(SHUT_WR)"
|
|
13682
|
+
}
|
|
13683
|
+
});
|
|
13684
|
+
//#endregion
|
|
13081
13685
|
//#region src/proxy/tcp-proxies.ts
|
|
13082
13686
|
const TOXI = "toxiproxy v2.12.0";
|
|
13083
13687
|
const MOBY = "moby docker-v29.1.5";
|
|
@@ -15492,6 +16096,7 @@ const MACHINES = byId([
|
|
|
15492
16096
|
NODE_HTTP_SERVER,
|
|
15493
16097
|
NODE_HTTP_AGENT,
|
|
15494
16098
|
UNDICI_CLIENT,
|
|
16099
|
+
UNDICI_RETRY,
|
|
15495
16100
|
GO_TRANSPORT,
|
|
15496
16101
|
PROCEDURES_WS_CLIENT,
|
|
15497
16102
|
PROCEDURES_WS_SERVER,
|
|
@@ -15516,9 +16121,10 @@ const MACHINES = byId([
|
|
|
15516
16121
|
TOXIPROXY_LINK,
|
|
15517
16122
|
DOCKER_PROXY_LINK,
|
|
15518
16123
|
ENVOY_HTTP2,
|
|
15519
|
-
CADDY_HTTP2
|
|
16124
|
+
CADDY_HTTP2,
|
|
16125
|
+
NGINX_GRPC
|
|
15520
16126
|
]);
|
|
15521
16127
|
//#endregion
|
|
15522
|
-
export { AMQPLIB, ATEN_DETECTOR, CADDY_HTTP2, DOCKER_PROXY_LINK, ENVOY_HTTP2, ETCD_SERVER, GO_TRANSPORT, GRPC_GO_SERVER, GRPC_JS, HIKARICP_PGJDBC, IOREDIS_SENTINEL, IOREDIS_STATUS, LINUX_TCP, MACHINES, MANIFESTATIONS, MONGODB_NODE, MONGOD_REPL, MONGOD_SESSION, NF_CONNTRACK_TCP, NODE_HTTP_AGENT, NODE_HTTP_SERVER, NODE_POSTGRES, NODE_TIMER_EARLY, PGBOUNCER_CLIENT, PGBOUNCER_SERVER, PGPOOL_SESSION, POSTGRES_SESSION, PROCEDURES_WS_CLIENT, PROCEDURES_WS_SERVER, RABBITMQ_CONNECTION, RA_MEMBER, REDIS_CLIENT, SENTINEL, SUPAVISOR_CLIENT, SUPAVISOR_SERVER, TOXIPROXY_LINK, UNDICI_CLIENT, UNDICI_TICK_MS, goLateSeconds, goTimerLateness, nodeEarlySeconds, nodeLateSeconds, nodeTimerLateness, undiciFastEarly, undiciFastLateness };
|
|
16128
|
+
export { AMQPLIB, ATEN_DETECTOR, CADDY_HTTP2, DOCKER_PROXY_LINK, ENVOY_HTTP2, ETCD_SERVER, GO_TRANSPORT, GRPC_GO_SERVER, GRPC_JS, HIKARICP_PGJDBC, IOREDIS_SENTINEL, IOREDIS_STATUS, LINUX_TCP, MACHINES, MANIFESTATIONS, MONGODB_NODE, MONGOD_REPL, MONGOD_SESSION, NF_CONNTRACK_TCP, NGINX_GRPC, NODE_HTTP_AGENT, NODE_HTTP_SERVER, NODE_POSTGRES, NODE_TIMER_EARLY, PGBOUNCER_CLIENT, PGBOUNCER_SERVER, PGPOOL_SESSION, POSTGRES_SESSION, PROCEDURES_WS_CLIENT, PROCEDURES_WS_SERVER, RABBITMQ_CONNECTION, RA_MEMBER, REDIS_CLIENT, SENTINEL, SUPAVISOR_CLIENT, SUPAVISOR_SERVER, TOXIPROXY_LINK, UNDICI_CLIENT, UNDICI_RETRY, UNDICI_TICK_MS, goLateSeconds, goTimerLateness, nodeEarlySeconds, nodeLateSeconds, nodeTimerLateness, undiciFastEarly, undiciFastLateness };
|
|
15523
16129
|
|
|
15524
16130
|
//# sourceMappingURL=index.js.map
|