@mark1russell7/machines 0.3.22 → 0.3.24
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 +9 -3
- package/build/index.d.ts +7 -5
- package/build/index.js +258 -213
- package/build/index.js.map +1 -1
- package/package.json +2 -2
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$15 = "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$15} 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$15} 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$15} 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$15} 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$15} 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$15} 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$15} 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$15} 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$15} 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$15} 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$14 = "@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$14}/transport.ts:70 KEEPALIVE_TIMEOUT_MS is 20000`,
|
|
736
736
|
rung: "implemented"
|
|
737
737
|
},
|
|
738
738
|
{
|
|
739
|
-
ref: `${AT$
|
|
739
|
+
ref: `${AT$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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$14}/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,23 +816,23 @@ const GRPC_JS = machineSchema.parse({
|
|
|
816
816
|
rung: "observed"
|
|
817
817
|
},
|
|
818
818
|
{
|
|
819
|
-
ref: `${AT$
|
|
819
|
+
ref: `${AT$14}/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$14}/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$14}/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$14}/backoff-timeout.ts:124, :169-181, :197-201 the first wait after a reset is the initial delay, with no jitter. Each next wait is the last wait, jitter included, times 1.6 and capped, then ± 20 %: the jitter compounds`,
|
|
832
832
|
rung: "implemented"
|
|
833
833
|
},
|
|
834
834
|
{
|
|
835
|
-
ref: `${AT$
|
|
835
|
+
ref: `${AT$14}/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`,
|
|
836
836
|
rung: "implemented"
|
|
837
837
|
},
|
|
838
838
|
{
|
|
@@ -2586,7 +2586,7 @@ const UNDICI_CLIENT = machineSchema.parse({
|
|
|
2586
2586
|
});
|
|
2587
2587
|
//#endregion
|
|
2588
2588
|
//#region src/http/undici-retry.ts
|
|
2589
|
-
const AT$
|
|
2589
|
+
const AT$13 = "undici 8.12.2 lib/handler/retry-handler.js";
|
|
2590
2590
|
/**
|
|
2591
2591
|
* This document is one request through a `RetryAgent` of undici 8.12.2: the retries of a reply
|
|
2592
2592
|
* whose status is retryable, for example 429 or 503. Each fact comes from the published package at
|
|
@@ -2620,7 +2620,7 @@ const UNDICI_RETRY = machineSchema.parse({
|
|
|
2620
2620
|
},
|
|
2621
2621
|
sources: [
|
|
2622
2622
|
{
|
|
2623
|
-
ref: `${AT$
|
|
2623
|
+
ref: `${AT$13}: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`,
|
|
2624
2624
|
rung: "implemented"
|
|
2625
2625
|
},
|
|
2626
2626
|
{
|
|
@@ -2628,19 +2628,19 @@ const UNDICI_RETRY = machineSchema.parse({
|
|
|
2628
2628
|
rung: "implemented"
|
|
2629
2629
|
},
|
|
2630
2630
|
{
|
|
2631
|
-
ref: `${AT$
|
|
2631
|
+
ref: `${AT$13}:331-351 the policy: a method or a status out of its lists is not retried, and a counter above maxRetries gives up`,
|
|
2632
2632
|
rung: "implemented"
|
|
2633
2633
|
},
|
|
2634
2634
|
{
|
|
2635
|
-
ref: `${AT$
|
|
2635
|
+
ref: `${AT$13}: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`,
|
|
2636
2636
|
rung: "implemented"
|
|
2637
2637
|
},
|
|
2638
2638
|
{
|
|
2639
|
-
ref: `${AT$
|
|
2639
|
+
ref: `${AT$13}:380 the counter: one more at each reply`,
|
|
2640
2640
|
rung: "implemented"
|
|
2641
2641
|
},
|
|
2642
2642
|
{
|
|
2643
|
-
ref: `${AT$
|
|
2643
|
+
ref: `${AT$13}:175-192 and :518-535 a retryable status with throwOnError drops the body of the reply, and the error goes to the policy`,
|
|
2644
2644
|
rung: "implemented"
|
|
2645
2645
|
},
|
|
2646
2646
|
{
|
|
@@ -2802,7 +2802,7 @@ const UNDICI_RETRY = machineSchema.parse({
|
|
|
2802
2802
|
});
|
|
2803
2803
|
//#endregion
|
|
2804
2804
|
//#region src/ioredis-sentinel.ts
|
|
2805
|
-
const AT$
|
|
2805
|
+
const AT$12 = "ioredis 6.0.0 built";
|
|
2806
2806
|
/**
|
|
2807
2807
|
* This document is the Sentinel path of ioredis 6.0.0. It tells how ioredis finds the primary of a
|
|
2808
2808
|
* group through the Sentinels, loses it, and connects to the new one. The standalone states of
|
|
@@ -2823,43 +2823,43 @@ const IOREDIS_SENTINEL = machineSchema.parse({
|
|
|
2823
2823
|
},
|
|
2824
2824
|
sources: [
|
|
2825
2825
|
{
|
|
2826
|
-
ref: `${AT$
|
|
2826
|
+
ref: `${AT$12}/connectors/SentinelConnector/index.js:46-121 connect (each Sentinel in turn, then sentinelRetryStrategy)`,
|
|
2827
2827
|
rung: "implemented"
|
|
2828
2828
|
},
|
|
2829
2829
|
{
|
|
2830
|
-
ref: `${AT$
|
|
2830
|
+
ref: `${AT$12}/connectors/SentinelConnector/index.js:145-151 resolveMaster (get-master-addr-by-name, then SENTINEL sentinels)`,
|
|
2831
2831
|
rung: "implemented"
|
|
2832
2832
|
},
|
|
2833
2833
|
{
|
|
2834
|
-
ref: `${AT$
|
|
2834
|
+
ref: `${AT$12}/connectors/SentinelConnector/index.js:175-212 connectToSentinel and resolve (one connection for each question, no retry)`,
|
|
2835
2835
|
rung: "implemented"
|
|
2836
2836
|
},
|
|
2837
2837
|
{
|
|
2838
|
-
ref: `${AT$
|
|
2838
|
+
ref: `${AT$12}/connectors/SentinelConnector/index.js:27-39 check (the role of the ready check)`,
|
|
2839
2839
|
rung: "implemented"
|
|
2840
2840
|
},
|
|
2841
2841
|
{
|
|
2842
|
-
ref: `${AT$
|
|
2842
|
+
ref: `${AT$12}/connectors/SentinelConnector/FailoverDetector.js:6-43 (+switch-master, only with failoverDetector)`,
|
|
2843
2843
|
rung: "implemented"
|
|
2844
2844
|
},
|
|
2845
2845
|
{
|
|
2846
|
-
ref: `${AT$
|
|
2846
|
+
ref: `${AT$12}/redis/RedisOptions.js:9-57 (the defaults)`,
|
|
2847
2847
|
rung: "implemented"
|
|
2848
2848
|
},
|
|
2849
2849
|
{
|
|
2850
|
-
ref: `${AT$
|
|
2850
|
+
ref: `${AT$12}/redis/event_handler.js:294-355 closeHandler (retryStrategy, then maxRetriesPerRequest flushes the queue)`,
|
|
2851
2851
|
rung: "implemented"
|
|
2852
2852
|
},
|
|
2853
2853
|
{
|
|
2854
|
-
ref: `${AT$
|
|
2854
|
+
ref: `${AT$12}/redis/event_handler.js:364-449 readyHandler (retryAttempts back to 0, the resend, the offline queue)`,
|
|
2855
2855
|
rung: "implemented"
|
|
2856
2856
|
},
|
|
2857
2857
|
{
|
|
2858
|
-
ref: `${AT$
|
|
2858
|
+
ref: `${AT$12}/Redis.js:123-240 _connect (connectTimeout, keepAlive) and :379-405 sendCommand (the offline queue)`,
|
|
2859
2859
|
rung: "implemented"
|
|
2860
2860
|
},
|
|
2861
2861
|
{
|
|
2862
|
-
ref: `${AT$
|
|
2862
|
+
ref: `${AT$12}/Redis.js:599-605 handleReconnection (reconnectOnError: null, thus a READONLY error goes to the caller)`,
|
|
2863
2863
|
rung: "implemented"
|
|
2864
2864
|
}
|
|
2865
2865
|
],
|
|
@@ -3478,6 +3478,10 @@ var linux_tcp_default = {
|
|
|
3478
3478
|
{
|
|
3479
3479
|
"ref": "net/ipv4/tcp_input.c:791-834 tcp_event_data_recv(): the first data starts quick-ACK mode; :326-333 tcp_in_quickack_mode(); :5552-5576 __tcp_ack_snd_check(): an ACK at once or delayed; net/ipv4/tcp_output.c:161-176 tcp_event_data_sent(): ping-pong mode",
|
|
3480
3480
|
"rung": "implemented"
|
|
3481
|
+
},
|
|
3482
|
+
{
|
|
3483
|
+
"ref": "net/ipv4/tcp_timer.c:604 and :624-631 tcp_retransmit_timer(): each firing sends the SYN again, and in SYN_SENT the RTO doubles only after tcp_syn_linear_timeouts firings; the same at 6.17 (:448 total_rto, :671-678)",
|
|
3484
|
+
"rung": "implemented"
|
|
3481
3485
|
}
|
|
3482
3486
|
],
|
|
3483
3487
|
states: {
|
|
@@ -3541,6 +3545,10 @@ var linux_tcp_default = {
|
|
|
3541
3545
|
"note": "the first retransmission the RTO timer makes, which sets retrans_stamp; the tail loss probe one RTO earlier does not"
|
|
3542
3546
|
},
|
|
3543
3547
|
"timer.syn.exhausted": { "kind": "timer" },
|
|
3548
|
+
"timer.syn": {
|
|
3549
|
+
"kind": "timer",
|
|
3550
|
+
"note": "the SYN timer fires and the SYN goes out again"
|
|
3551
|
+
},
|
|
3544
3552
|
"timer.synack.exhausted": { "kind": "timer" },
|
|
3545
3553
|
"timer.rto": {
|
|
3546
3554
|
"kind": "timer",
|
|
@@ -3661,6 +3669,32 @@ var linux_tcp_default = {
|
|
|
3661
3669
|
"fires": "timer.syn.exhausted",
|
|
3662
3670
|
"note": "6.6: linear 1 s waits for the first tcp_syn_linear_timeouts retransmissions, then doubling; 131 s at the defaults. Each wait is a timer of the wheel, rounded up at its level: up to 6.08 s late in all at HZ 1000, because the wait of 64 s can be 4.096 s late"
|
|
3663
3671
|
},
|
|
3672
|
+
"syn_retransmit": {
|
|
3673
|
+
"duration": {
|
|
3674
|
+
"model": "linux.syn-wait",
|
|
3675
|
+
"knobs": ["fired", "tcp_syn_linear_timeouts"],
|
|
3676
|
+
"unit": "s"
|
|
3677
|
+
},
|
|
3678
|
+
"lateness": {
|
|
3679
|
+
"model": "linux.syn-wait-lateness",
|
|
3680
|
+
"knobs": [
|
|
3681
|
+
"fired",
|
|
3682
|
+
"tcp_syn_linear_timeouts",
|
|
3683
|
+
"hz"
|
|
3684
|
+
],
|
|
3685
|
+
"unit": "s"
|
|
3686
|
+
},
|
|
3687
|
+
"early": {
|
|
3688
|
+
"model": "linux.jiffy",
|
|
3689
|
+
"knobs": ["hz"],
|
|
3690
|
+
"unit": "s"
|
|
3691
|
+
},
|
|
3692
|
+
"arms": ["enter:SYN_SENT"],
|
|
3693
|
+
"cancels": ["rx.synack", "rx.rst"],
|
|
3694
|
+
"fires": "timer.syn",
|
|
3695
|
+
"backoff": { "resets": ["enter:SYN_SENT"] },
|
|
3696
|
+
"note": "each firing sends the SYN again: the waits 0 to tcp_syn_linear_timeouts keep the initial RTO of 1 s (TCP_TIMEOUT_INIT), then each firing doubles the wait, up to TCP_RTO_MAX. Each wait is a timer of the wheel: a wait of 1 s is up to 64 ms late at HZ 1000. syn_giveup is what gives up on it. Through a stall of the path, the first SYN after its end gets through (recovery)"
|
|
3697
|
+
},
|
|
3664
3698
|
"retransmit": {
|
|
3665
3699
|
"duration": {
|
|
3666
3700
|
"model": "linux.rto-wait",
|
|
@@ -5019,7 +5053,7 @@ const IOREDIS_STATUS = machineSchema.parse(ioredis_status_default);
|
|
|
5019
5053
|
const MANIFESTATIONS = z.record(z.string(), z.array(z.string())).parse(manifestations_default);
|
|
5020
5054
|
//#endregion
|
|
5021
5055
|
//#region src/mongo/mongod-replication.ts
|
|
5022
|
-
const AT$
|
|
5056
|
+
const AT$11 = "mongodb r9.0.4 src/mongo/db/repl";
|
|
5023
5057
|
/**
|
|
5024
5058
|
* This document is the replication of mongod 9.0.4. It gives one member of a replica set, its view
|
|
5025
5059
|
* of the primary, and the election that it can hold. The states are the states of the member. The
|
|
@@ -5050,95 +5084,95 @@ const MONGOD_REPL = machineSchema.parse({
|
|
|
5050
5084
|
},
|
|
5051
5085
|
sources: [
|
|
5052
5086
|
{
|
|
5053
|
-
ref: `${AT$
|
|
5087
|
+
ref: `${AT$11}/repl_set_config.idl:74-109 the settings: heartbeatIntervalMillis 2000, heartbeatTimeoutSecs 10, electionTimeoutMillis 10000, catchUpTimeoutMillis -1, catchUpTakeoverDelayMillis 30000`,
|
|
5054
5088
|
rung: "implemented"
|
|
5055
5089
|
},
|
|
5056
5090
|
{
|
|
5057
|
-
ref: `${AT$
|
|
5091
|
+
ref: `${AT$11}/repl_server_parameters.idl:320-328 replElectionTimeoutOffsetLimitFraction 0.15`,
|
|
5058
5092
|
rung: "implemented"
|
|
5059
5093
|
},
|
|
5060
5094
|
{
|
|
5061
|
-
ref: `${AT$
|
|
5095
|
+
ref: `${AT$11}/topology_coordinator.cpp:1058-1101 the heartbeat window and the timeout of each request, :1124-1147 the next heartbeat, :1239-1248 a member DOWN`,
|
|
5062
5096
|
rung: "implemented"
|
|
5063
5097
|
},
|
|
5064
5098
|
{
|
|
5065
|
-
ref: `${AT$
|
|
5099
|
+
ref: `${AT$11}/topology_coordinator.h:62 kMaxHeartbeatRetries 2`,
|
|
5066
5100
|
rung: "implemented"
|
|
5067
5101
|
},
|
|
5068
5102
|
{
|
|
5069
|
-
ref: `${AT$
|
|
5103
|
+
ref: `${AT$11}/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`,
|
|
5070
5104
|
rung: "implemented"
|
|
5071
5105
|
},
|
|
5072
5106
|
{
|
|
5073
|
-
ref: `${AT$
|
|
5107
|
+
ref: `${AT$11}/data_replicator_external_state_impl.cpp:70-81 an oplog batch that names a primary postpones the election`,
|
|
5074
5108
|
rung: "implemented"
|
|
5075
5109
|
},
|
|
5076
5110
|
{
|
|
5077
|
-
ref: `${AT$
|
|
5111
|
+
ref: `${AT$11}/delayable_timeout_callback.cpp:149-172 the offset changes at most once in its own length`,
|
|
5078
5112
|
rung: "implemented"
|
|
5079
5113
|
},
|
|
5080
5114
|
{
|
|
5081
|
-
ref: `${AT$
|
|
5115
|
+
ref: `${AT$11}/topology_coordinator.cpp:1440-1457 and :1476-1489 the liveness check: a primary that cannot see a majority steps down`,
|
|
5082
5116
|
rung: "implemented"
|
|
5083
5117
|
},
|
|
5084
5118
|
{
|
|
5085
|
-
ref: `${AT$
|
|
5119
|
+
ref: `${AT$11}/replication_coordinator_impl_heartbeat.cpp:1158-1188 the liveness check runs at the stalest member's last update plus the election timeout`,
|
|
5086
5120
|
rung: "implemented"
|
|
5087
5121
|
},
|
|
5088
5122
|
{
|
|
5089
|
-
ref: `${AT$
|
|
5123
|
+
ref: `${AT$11}/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`,
|
|
5090
5124
|
rung: "implemented"
|
|
5091
5125
|
},
|
|
5092
5126
|
{
|
|
5093
|
-
ref: `${AT$
|
|
5127
|
+
ref: `${AT$11}/vote_requester.cpp:96 a vote request times out at min(electionTimeoutMillis, 30 s), :160-177 a majority of yes votes ends the round`,
|
|
5094
5128
|
rung: "implemented"
|
|
5095
5129
|
},
|
|
5096
5130
|
{
|
|
5097
|
-
ref: `${AT$
|
|
5131
|
+
ref: `${AT$11}/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`,
|
|
5098
5132
|
rung: "implemented"
|
|
5099
5133
|
},
|
|
5100
5134
|
{
|
|
5101
|
-
ref: `${AT$
|
|
5135
|
+
ref: `${AT$11}/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`,
|
|
5102
5136
|
rung: "implemented"
|
|
5103
5137
|
},
|
|
5104
5138
|
{
|
|
5105
|
-
ref: `${AT$
|
|
5139
|
+
ref: `${AT$11}/topology_coordinator.cpp:3841-3849 and :3910-3932 a restarted heartbeat, and the latest optime that the catch-up waits for`,
|
|
5106
5140
|
rung: "implemented"
|
|
5107
5141
|
},
|
|
5108
5142
|
{
|
|
5109
|
-
ref: `${AT$
|
|
5143
|
+
ref: `${AT$11}/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`,
|
|
5110
5144
|
rung: "implemented"
|
|
5111
5145
|
},
|
|
5112
5146
|
{
|
|
5113
|
-
ref: `${AT$
|
|
5147
|
+
ref: `${AT$11}/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`,
|
|
5114
5148
|
rung: "implemented"
|
|
5115
5149
|
},
|
|
5116
5150
|
{
|
|
5117
|
-
ref: `${AT$
|
|
5151
|
+
ref: `${AT$11}/repl_set_commands.cpp:545-561 stepDownSecs 60 and secondaryCatchUpPeriodSecs 10`,
|
|
5118
5152
|
rung: "implemented"
|
|
5119
5153
|
},
|
|
5120
5154
|
{
|
|
5121
|
-
ref: `${AT$
|
|
5155
|
+
ref: `${AT$11}/replication_coordinator_impl.idl:18-26 enableElectionHandoff true, and replication_coordinator_impl.cpp:2830-2873 the hand-off: replSetStepUp with skipDryRun`,
|
|
5122
5156
|
rung: "implemented"
|
|
5123
5157
|
},
|
|
5124
5158
|
{
|
|
5125
|
-
ref: `${AT$
|
|
5159
|
+
ref: `${AT$11}/replication_coordinator_impl.cpp:1516 the reconfig of the term, :4598 and :4750 a new config starts each heartbeat again`,
|
|
5126
5160
|
rung: "implemented"
|
|
5127
5161
|
},
|
|
5128
5162
|
{
|
|
5129
|
-
ref: `${AT$
|
|
5163
|
+
ref: `${AT$11}/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`,
|
|
5130
5164
|
rung: "implemented"
|
|
5131
5165
|
},
|
|
5132
5166
|
{
|
|
5133
|
-
ref: `${AT$
|
|
5167
|
+
ref: `${AT$11}/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`,
|
|
5134
5168
|
rung: "implemented"
|
|
5135
5169
|
},
|
|
5136
5170
|
{
|
|
5137
|
-
ref: `${AT$
|
|
5171
|
+
ref: `${AT$11}/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`,
|
|
5138
5172
|
rung: "implemented"
|
|
5139
5173
|
},
|
|
5140
5174
|
{
|
|
5141
|
-
ref: `${AT$
|
|
5175
|
+
ref: `${AT$11}/repl_server_parameters.idl:121-126 oplogRetriedFindMaxSeconds 2, :234-244 oplogFetcherSteadyStateMaxFetcherRestarts 1, :344-351 oplogNetworkTimeoutBufferSeconds 5`,
|
|
5142
5176
|
rung: "implemented"
|
|
5143
5177
|
},
|
|
5144
5178
|
{
|
|
@@ -5146,19 +5180,19 @@ const MONGOD_REPL = machineSchema.parse({
|
|
|
5146
5180
|
rung: "implemented"
|
|
5147
5181
|
},
|
|
5148
5182
|
{
|
|
5149
|
-
ref: `${AT$
|
|
5183
|
+
ref: `${AT$11}/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`,
|
|
5150
5184
|
rung: "implemented"
|
|
5151
5185
|
},
|
|
5152
5186
|
{
|
|
5153
|
-
ref: `${AT$
|
|
5187
|
+
ref: `${AT$11}/replication_coordinator_impl.cpp:4947-4972 a member that loses its sync source starts each heartbeat again at once`,
|
|
5154
5188
|
rung: "implemented"
|
|
5155
5189
|
},
|
|
5156
5190
|
{
|
|
5157
|
-
ref: `${AT$
|
|
5191
|
+
ref: `${AT$11}/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`,
|
|
5158
5192
|
rung: "implemented"
|
|
5159
5193
|
},
|
|
5160
5194
|
{
|
|
5161
|
-
ref: `${AT$
|
|
5195
|
+
ref: `${AT$11}/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`,
|
|
5162
5196
|
rung: "implemented"
|
|
5163
5197
|
},
|
|
5164
5198
|
{
|
|
@@ -5777,7 +5811,7 @@ const MONGOD_REPL = machineSchema.parse({
|
|
|
5777
5811
|
});
|
|
5778
5812
|
//#endregion
|
|
5779
5813
|
//#region src/mongo/mongod-session.ts
|
|
5780
|
-
const AT$
|
|
5814
|
+
const AT$10 = "mongodb r9.0.4 src/mongo";
|
|
5781
5815
|
/**
|
|
5782
5816
|
* This document is the hold of mongod 9.0.4 on one client connection, over its socket. `mongod`
|
|
5783
5817
|
* turns keepalive on for each TCP session. It lowers two keepalive options of the socket to a
|
|
@@ -5804,27 +5838,27 @@ const MONGOD_SESSION = machineSchema.parse({
|
|
|
5804
5838
|
},
|
|
5805
5839
|
sources: [
|
|
5806
5840
|
{
|
|
5807
|
-
ref: `${AT$
|
|
5841
|
+
ref: `${AT$10}/transport/asio/asio_session_impl.cpp:156-165 each TCP session: TCP_NODELAY, SO_KEEPALIVE, setSocketKeepAliveParams, failures at debug 3 in a release build`,
|
|
5808
5842
|
rung: "implemented"
|
|
5809
5843
|
},
|
|
5810
5844
|
{
|
|
5811
|
-
ref: `${AT$
|
|
5845
|
+
ref: `${AT$10}/util/net/socket_utils.h:15-16 kMaxKeepIdleSecs 300 and kMaxKeepIntvlSecs 1, :19-22 the defaults of setSocketKeepAliveParams`,
|
|
5812
5846
|
rung: "implemented"
|
|
5813
5847
|
},
|
|
5814
5848
|
{
|
|
5815
|
-
ref: `${AT$
|
|
5849
|
+
ref: `${AT$10}/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`,
|
|
5816
5850
|
rung: "implemented"
|
|
5817
5851
|
},
|
|
5818
5852
|
{
|
|
5819
|
-
ref: `${AT$
|
|
5853
|
+
ref: `${AT$10}/util/net/socket_utils.cpp:176-181 and :190-194 the log of a failed read or set, at the severity of the caller`,
|
|
5820
5854
|
rung: "implemented"
|
|
5821
5855
|
},
|
|
5822
5856
|
{
|
|
5823
|
-
ref: `${AT$
|
|
5857
|
+
ref: `${AT$10}/util/net/sock.cpp:135-142 the older socket path: SO_KEEPALIVE, then the same maximums, failures as errors`,
|
|
5824
5858
|
rung: "implemented"
|
|
5825
5859
|
},
|
|
5826
5860
|
{
|
|
5827
|
-
ref: `${AT$
|
|
5861
|
+
ref: `${AT$10}/db/repl/replication_info.cpp:131-143 an awaitable hello waits until now + maxAwaitTimeMS on the precise clock, or a change of the topology`,
|
|
5828
5862
|
rung: "implemented"
|
|
5829
5863
|
}
|
|
5830
5864
|
],
|
|
@@ -5986,7 +6020,7 @@ const MONGOD_SESSION = machineSchema.parse({
|
|
|
5986
6020
|
});
|
|
5987
6021
|
//#endregion
|
|
5988
6022
|
//#region src/mongo/mongodb-node.ts
|
|
5989
|
-
const AT$
|
|
6023
|
+
const AT$9 = "mongodb 7.7.0 src";
|
|
5990
6024
|
/**
|
|
5991
6025
|
* This document is the MongoDB Node driver 7.7.0, for one server of a replica set. It gives one
|
|
5992
6026
|
* connection of the driver by its role, and the timers that act on it. The roles are the monitor
|
|
@@ -6013,75 +6047,75 @@ const MONGODB_NODE = machineSchema.parse({
|
|
|
6013
6047
|
},
|
|
6014
6048
|
sources: [
|
|
6015
6049
|
{
|
|
6016
|
-
ref: `${AT$
|
|
6050
|
+
ref: `${AT$9}/connection_string.ts:804-807 connectTimeoutMS 30000, :850-853 heartbeatFrequencyMS 10000, :934-937 minHeartbeatFrequencyMS 500`,
|
|
6017
6051
|
rung: "implemented"
|
|
6018
6052
|
},
|
|
6019
6053
|
{
|
|
6020
|
-
ref: `${AT$
|
|
6054
|
+
ref: `${AT$9}/connection_string.ts:1100-1103 serverSelectionTimeoutMS 30000, :1107-1111 socketTimeoutMS 0, :1178-1182 waitQueueTimeoutMS 0`,
|
|
6021
6055
|
rung: "implemented"
|
|
6022
6056
|
},
|
|
6023
6057
|
{
|
|
6024
|
-
ref: `${AT$
|
|
6058
|
+
ref: `${AT$9}/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`,
|
|
6025
6059
|
rung: "implemented"
|
|
6026
6060
|
},
|
|
6027
6061
|
{
|
|
6028
|
-
ref: `${AT$
|
|
6062
|
+
ref: `${AT$9}/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`,
|
|
6029
6063
|
rung: "implemented"
|
|
6030
6064
|
},
|
|
6031
6065
|
{
|
|
6032
|
-
ref: `${AT$
|
|
6066
|
+
ref: `${AT$9}/cmap/connect.ts:117-120 the handshake reads with socketTimeoutMS = connectTimeoutMS`,
|
|
6033
6067
|
rung: "implemented"
|
|
6034
6068
|
},
|
|
6035
6069
|
{
|
|
6036
|
-
ref: `${AT$
|
|
6070
|
+
ref: `${AT$9}/sdam/monitor.ts:245-259 the streaming protocol, :338-371 the awaitable hello: maxAwaitTimeMS = heartbeatFrequencyMS, socketTimeoutMS = connectTimeoutMS + maxAwaitTimeMS`,
|
|
6037
6071
|
rung: "implemented"
|
|
6038
6072
|
},
|
|
6039
6073
|
{
|
|
6040
|
-
ref: `${AT$
|
|
6074
|
+
ref: `${AT$9}/sdam/monitor.ts:273-293 a failed heartbeat: ResetPool, and InterruptInUseConnections for a timeout`,
|
|
6041
6075
|
rung: "implemented"
|
|
6042
6076
|
},
|
|
6043
6077
|
{
|
|
6044
|
-
ref: `${AT$
|
|
6078
|
+
ref: `${AT$9}/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`,
|
|
6045
6079
|
rung: "implemented"
|
|
6046
6080
|
},
|
|
6047
6081
|
{
|
|
6048
|
-
ref: `${AT$
|
|
6082
|
+
ref: `${AT$9}/sdam/monitor.ts:490-565 the RTT pinger: its own connection, a hello each heartbeatFrequencyMS, no socket timeout`,
|
|
6049
6083
|
rung: "implemented"
|
|
6050
6084
|
},
|
|
6051
6085
|
{
|
|
6052
|
-
ref: `${AT$
|
|
6086
|
+
ref: `${AT$9}/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`,
|
|
6053
6087
|
rung: "implemented"
|
|
6054
6088
|
},
|
|
6055
6089
|
{
|
|
6056
|
-
ref: `${AT$
|
|
6090
|
+
ref: `${AT$9}/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`,
|
|
6057
6091
|
rung: "implemented"
|
|
6058
6092
|
},
|
|
6059
6093
|
{
|
|
6060
|
-
ref: `${AT$
|
|
6094
|
+
ref: `${AT$9}/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`,
|
|
6061
6095
|
rung: "implemented"
|
|
6062
6096
|
},
|
|
6063
6097
|
{
|
|
6064
|
-
ref: `${AT$
|
|
6098
|
+
ref: `${AT$9}/sdam/topology_description.ts:458-467 a primary that another primary replaces is Unknown, and nothing clears its pool`,
|
|
6065
6099
|
rung: "implemented"
|
|
6066
6100
|
},
|
|
6067
6101
|
{
|
|
6068
|
-
ref: `${AT$
|
|
6102
|
+
ref: `${AT$9}/cmap/connection_pool.ts:417-468 clear, :475-481 interruptInUseConnections: PoolClearedOnNetworkError, :584 a connection idle for maxIdleTimeMS is perished at the next check-out`,
|
|
6069
6103
|
rung: "implemented"
|
|
6070
6104
|
},
|
|
6071
6105
|
{
|
|
6072
|
-
ref: `${AT$
|
|
6106
|
+
ref: `${AT$9}/cmap/errors.ts:37-84 PoolClearedError and PoolClearedOnNetworkError, with the label PoolRequestedRetry`,
|
|
6073
6107
|
rung: "implemented"
|
|
6074
6108
|
},
|
|
6075
6109
|
{
|
|
6076
|
-
ref: `${AT$
|
|
6110
|
+
ref: `${AT$9}/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`,
|
|
6077
6111
|
rung: "implemented"
|
|
6078
6112
|
},
|
|
6079
6113
|
{
|
|
6080
|
-
ref: `${AT$
|
|
6114
|
+
ref: `${AT$9}/error.ts:1377-1394 the retryable codes, :1431-1436 isRetryableWriteError: RetryableWriteError or PoolRequestedRetry`,
|
|
6081
6115
|
rung: "implemented"
|
|
6082
6116
|
},
|
|
6083
6117
|
{
|
|
6084
|
-
ref: `${AT$
|
|
6118
|
+
ref: `${AT$9}/timeout.ts:362-372 the legacy timeout context: the selection timeout, and no check-out timeout at waitQueueTimeoutMS 0`,
|
|
6085
6119
|
rung: "implemented"
|
|
6086
6120
|
},
|
|
6087
6121
|
{
|
|
@@ -7761,7 +7795,7 @@ const HIKARICP_PGJDBC = machineSchema.parse({
|
|
|
7761
7795
|
});
|
|
7762
7796
|
//#endregion
|
|
7763
7797
|
//#region src/pg/node-postgres.ts
|
|
7764
|
-
const AT$
|
|
7798
|
+
const AT$8 = "pg 8.23.1 lib";
|
|
7765
7799
|
const POOL = "pg-pool 3.14.0";
|
|
7766
7800
|
/**
|
|
7767
7801
|
* This document is node-postgres 8.23.1 (the npm package pg) with pg-pool 3.14.0, for one client
|
|
@@ -7803,75 +7837,75 @@ const NODE_POSTGRES = machineSchema.parse({
|
|
|
7803
7837
|
rung: "implemented"
|
|
7804
7838
|
},
|
|
7805
7839
|
{
|
|
7806
|
-
ref: `${AT$
|
|
7840
|
+
ref: `${AT$8}/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`,
|
|
7807
7841
|
rung: "implemented"
|
|
7808
7842
|
},
|
|
7809
7843
|
{
|
|
7810
|
-
ref: `${AT$
|
|
7844
|
+
ref: `${AT$8}/defaults.js:65, :69, :73 and :76 statement_timeout, lock_timeout, idle_in_transaction_session_timeout and query_timeout are false`,
|
|
7811
7845
|
rung: "implemented"
|
|
7812
7846
|
},
|
|
7813
7847
|
{
|
|
7814
|
-
ref: `${AT$
|
|
7848
|
+
ref: `${AT$8}/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`,
|
|
7815
7849
|
rung: "documented"
|
|
7816
7850
|
},
|
|
7817
7851
|
{
|
|
7818
|
-
ref: `${AT$
|
|
7852
|
+
ref: `${AT$8}/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`,
|
|
7819
7853
|
rung: "implemented"
|
|
7820
7854
|
},
|
|
7821
7855
|
{
|
|
7822
|
-
ref: `${AT$
|
|
7856
|
+
ref: `${AT$8}/client.js:89-98 the Connection gets keepAlive false and keepAliveInitialDelayMillis 0 when the config does not give them, :116 connectionTimeoutMillis 0`,
|
|
7823
7857
|
rung: "implemented"
|
|
7824
7858
|
},
|
|
7825
7859
|
{
|
|
7826
|
-
ref: `${AT$
|
|
7860
|
+
ref: `${AT$8}/stream.js:20-24 and :78-83 outside Cloudflare Workers, the socket is a new net.Socket with no option`,
|
|
7827
7861
|
rung: "implemented"
|
|
7828
7862
|
},
|
|
7829
7863
|
{
|
|
7830
|
-
ref: `${AT$
|
|
7864
|
+
ref: `${AT$8}/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`,
|
|
7831
7865
|
rung: "implemented"
|
|
7832
7866
|
},
|
|
7833
7867
|
{
|
|
7834
|
-
ref: `${AT$
|
|
7868
|
+
ref: `${AT$8}/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`,
|
|
7835
7869
|
rung: "implemented"
|
|
7836
7870
|
},
|
|
7837
7871
|
{
|
|
7838
|
-
ref: `${AT$
|
|
7872
|
+
ref: `${AT$8}/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`,
|
|
7839
7873
|
rung: "implemented"
|
|
7840
7874
|
},
|
|
7841
7875
|
{
|
|
7842
|
-
ref: `${AT$
|
|
7876
|
+
ref: `${AT$8}/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`,
|
|
7843
7877
|
rung: "implemented"
|
|
7844
7878
|
},
|
|
7845
7879
|
{
|
|
7846
|
-
ref: `${AT$
|
|
7880
|
+
ref: `${AT$8}/client.js:426-442 an ErrorResponse fails the active query only, and with no active query it is an error of the client`,
|
|
7847
7881
|
rung: "implemented"
|
|
7848
7882
|
},
|
|
7849
7883
|
{
|
|
7850
|
-
ref: `${AT$
|
|
7884
|
+
ref: `${AT$8}/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`,
|
|
7851
7885
|
rung: "implemented"
|
|
7852
7886
|
},
|
|
7853
7887
|
{
|
|
7854
|
-
ref: `${AT$
|
|
7888
|
+
ref: `${AT$8}/client.js:133-151 _errorAllQueries: each query of the client fails with the same error, on the next tick`,
|
|
7855
7889
|
rung: "implemented"
|
|
7856
7890
|
},
|
|
7857
7891
|
{
|
|
7858
|
-
ref: `${AT$
|
|
7892
|
+
ref: `${AT$8}/query.js:122-150 a query gives its error or its result to its callback, at the error or at the ReadyForQuery`,
|
|
7859
7893
|
rung: "implemented"
|
|
7860
7894
|
},
|
|
7861
7895
|
{
|
|
7862
|
-
ref: `${AT$
|
|
7896
|
+
ref: `${AT$8}/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`,
|
|
7863
7897
|
rung: "implemented"
|
|
7864
7898
|
},
|
|
7865
7899
|
{
|
|
7866
|
-
ref: `${AT$
|
|
7900
|
+
ref: `${AT$8}/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`,
|
|
7867
7901
|
rung: "implemented"
|
|
7868
7902
|
},
|
|
7869
7903
|
{
|
|
7870
|
-
ref: `${AT$
|
|
7904
|
+
ref: `${AT$8}/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`,
|
|
7871
7905
|
rung: "implemented"
|
|
7872
7906
|
},
|
|
7873
7907
|
{
|
|
7874
|
-
ref: `${AT$
|
|
7908
|
+
ref: `${AT$8}/client.js:543-572 getStartupConf: statement_timeout, lock_timeout and idle_in_transaction_session_timeout go to the server only when they are set`,
|
|
7875
7909
|
rung: "implemented"
|
|
7876
7910
|
},
|
|
7877
7911
|
{
|
|
@@ -10267,7 +10301,7 @@ const PGPOOL_SESSION = machineSchema.parse({
|
|
|
10267
10301
|
});
|
|
10268
10302
|
//#endregion
|
|
10269
10303
|
//#region src/pg/postgres-session.ts
|
|
10270
|
-
const AT$
|
|
10304
|
+
const AT$7 = "postgresql REL_17_11 src";
|
|
10271
10305
|
const DOC = "postgresql REL_17_11 doc/src/sgml";
|
|
10272
10306
|
/**
|
|
10273
10307
|
* This document is the hold of a PostgreSQL 17.11 backend on one client connection, over its TCP
|
|
@@ -10307,163 +10341,163 @@ const POSTGRES_SESSION = machineSchema.parse({
|
|
|
10307
10341
|
rung: "implemented"
|
|
10308
10342
|
},
|
|
10309
10343
|
{
|
|
10310
|
-
ref: `${AT$
|
|
10344
|
+
ref: `${AT$7}/backend/tcop/backend_startup.c:157-161 BackendInitialize calls pq_init in the backend, before the startup packet`,
|
|
10311
10345
|
rung: "implemented"
|
|
10312
10346
|
},
|
|
10313
10347
|
{
|
|
10314
|
-
ref: `${AT$
|
|
10348
|
+
ref: `${AT$7}/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`,
|
|
10315
10349
|
rung: "implemented"
|
|
10316
10350
|
},
|
|
10317
10351
|
{
|
|
10318
|
-
ref: `${AT$
|
|
10352
|
+
ref: `${AT$7}/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`,
|
|
10319
10353
|
rung: "implemented"
|
|
10320
10354
|
},
|
|
10321
10355
|
{
|
|
10322
|
-
ref: `${AT$
|
|
10356
|
+
ref: `${AT$7}/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`,
|
|
10323
10357
|
rung: "implemented"
|
|
10324
10358
|
},
|
|
10325
10359
|
{
|
|
10326
|
-
ref: `${AT$
|
|
10360
|
+
ref: `${AT$7}/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`,
|
|
10327
10361
|
rung: "implemented"
|
|
10328
10362
|
},
|
|
10329
10363
|
{
|
|
10330
|
-
ref: `${AT$
|
|
10364
|
+
ref: `${AT$7}/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`,
|
|
10331
10365
|
rung: "implemented"
|
|
10332
10366
|
},
|
|
10333
10367
|
{
|
|
10334
|
-
ref: `${AT$
|
|
10368
|
+
ref: `${AT$7}/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`,
|
|
10335
10369
|
rung: "implemented"
|
|
10336
10370
|
},
|
|
10337
10371
|
{
|
|
10338
|
-
ref: `${AT$
|
|
10372
|
+
ref: `${AT$7}/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`,
|
|
10339
10373
|
rung: "implemented"
|
|
10340
10374
|
},
|
|
10341
10375
|
{
|
|
10342
|
-
ref: `${AT$
|
|
10376
|
+
ref: `${AT$7}/include/utils/timeout.h:3-4 and :23-43 one SIGALRM for each timeout id, STARTUP_PACKET_TIMEOUT to CLIENT_CONNECTION_CHECK_TIMEOUT`,
|
|
10343
10377
|
rung: "implemented"
|
|
10344
10378
|
},
|
|
10345
10379
|
{
|
|
10346
|
-
ref: `${AT$
|
|
10380
|
+
ref: `${AT$7}/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`,
|
|
10347
10381
|
rung: "implemented"
|
|
10348
10382
|
},
|
|
10349
10383
|
{
|
|
10350
|
-
ref: `${AT$
|
|
10384
|
+
ref: `${AT$7}/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`,
|
|
10351
10385
|
rung: "implemented"
|
|
10352
10386
|
},
|
|
10353
10387
|
{
|
|
10354
|
-
ref: `${AT$
|
|
10388
|
+
ref: `${AT$7}/backend/tcop/postgres.c:2999-3023 die (SIGTERM) sets ProcDiePending, :3029-3043 StatementCancelHandler (SIGINT) sets QueryCancelPending, :4292-4294 the two handlers`,
|
|
10355
10389
|
rung: "implemented"
|
|
10356
10390
|
},
|
|
10357
10391
|
{
|
|
10358
|
-
ref: `${AT$
|
|
10392
|
+
ref: `${AT$7}/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"`,
|
|
10359
10393
|
rung: "implemented"
|
|
10360
10394
|
},
|
|
10361
10395
|
{
|
|
10362
|
-
ref: `${AT$
|
|
10396
|
+
ref: `${AT$7}/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`,
|
|
10363
10397
|
rung: "implemented"
|
|
10364
10398
|
},
|
|
10365
10399
|
{
|
|
10366
|
-
ref: `${AT$
|
|
10400
|
+
ref: `${AT$7}/backend/tcop/postgres.c:3372-3430 a cancel: ERROR 55P03 "canceling statement due to lock timeout", ERROR 57014 "canceling statement due to statement timeout"`,
|
|
10367
10401
|
rung: "implemented"
|
|
10368
10402
|
},
|
|
10369
10403
|
{
|
|
10370
|
-
ref: `${AT$
|
|
10404
|
+
ref: `${AT$7}/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"`,
|
|
10371
10405
|
rung: "implemented"
|
|
10372
10406
|
},
|
|
10373
10407
|
{
|
|
10374
|
-
ref: `${AT$
|
|
10408
|
+
ref: `${AT$7}/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`,
|
|
10375
10409
|
rung: "implemented"
|
|
10376
10410
|
},
|
|
10377
10411
|
{
|
|
10378
|
-
ref: `${AT$
|
|
10412
|
+
ref: `${AT$7}/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`,
|
|
10379
10413
|
rung: "implemented"
|
|
10380
10414
|
},
|
|
10381
10415
|
{
|
|
10382
|
-
ref: `${AT$
|
|
10416
|
+
ref: `${AT$7}/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`,
|
|
10383
10417
|
rung: "implemented"
|
|
10384
10418
|
},
|
|
10385
10419
|
{
|
|
10386
|
-
ref: `${AT$
|
|
10420
|
+
ref: `${AT$7}/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`,
|
|
10387
10421
|
rung: "implemented"
|
|
10388
10422
|
},
|
|
10389
10423
|
{
|
|
10390
|
-
ref: `${AT$
|
|
10424
|
+
ref: `${AT$7}/backend/tcop/postgres.c:4446-4502 an ERROR: disable_all_timeouts, the error to the client, AbortCurrentTransaction; :4562-4563 then ReadyForQuery`,
|
|
10391
10425
|
rung: "implemented"
|
|
10392
10426
|
},
|
|
10393
10427
|
{
|
|
10394
|
-
ref: `${AT$
|
|
10428
|
+
ref: `${AT$7}/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`,
|
|
10395
10429
|
rung: "implemented"
|
|
10396
10430
|
},
|
|
10397
10431
|
{
|
|
10398
|
-
ref: `${AT$
|
|
10432
|
+
ref: `${AT$7}/backend/storage/lmgr/proc.c:1292-1307 ProcSleep arms lock_timeout with the deadlock timer, :1652-1666 and disarms it after the wait`,
|
|
10399
10433
|
rung: "implemented"
|
|
10400
10434
|
},
|
|
10401
10435
|
{
|
|
10402
|
-
ref: `${AT$
|
|
10436
|
+
ref: `${AT$7}/backend/tcop/postgres.c:3652-3661 a client_connection_check_interval above 0 needs a wait set that reports a close`,
|
|
10403
10437
|
rung: "implemented"
|
|
10404
10438
|
},
|
|
10405
10439
|
{
|
|
10406
|
-
ref: `${AT$
|
|
10440
|
+
ref: `${AT$7}/backend/libpq/pqcomm.c:2049-2084 pq_check_connection: a wait of 0 ms for WL_SOCKET_CLOSED`,
|
|
10407
10441
|
rung: "implemented"
|
|
10408
10442
|
},
|
|
10409
10443
|
{
|
|
10410
|
-
ref: `${AT$
|
|
10444
|
+
ref: `${AT$7}/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`,
|
|
10411
10445
|
rung: "implemented"
|
|
10412
10446
|
},
|
|
10413
10447
|
{
|
|
10414
|
-
ref: `${AT$
|
|
10448
|
+
ref: `${AT$7}/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`,
|
|
10415
10449
|
rung: "implemented"
|
|
10416
10450
|
},
|
|
10417
10451
|
{
|
|
10418
|
-
ref: `${AT$
|
|
10452
|
+
ref: `${AT$7}/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`,
|
|
10419
10453
|
rung: "implemented"
|
|
10420
10454
|
},
|
|
10421
10455
|
{
|
|
10422
|
-
ref: `${AT$
|
|
10456
|
+
ref: `${AT$7}/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"`,
|
|
10423
10457
|
rung: "implemented"
|
|
10424
10458
|
},
|
|
10425
10459
|
{
|
|
10426
|
-
ref: `${AT$
|
|
10460
|
+
ref: `${AT$7}/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)`,
|
|
10427
10461
|
rung: "implemented"
|
|
10428
10462
|
},
|
|
10429
10463
|
{
|
|
10430
|
-
ref: `${AT$
|
|
10464
|
+
ref: `${AT$7}/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`,
|
|
10431
10465
|
rung: "implemented"
|
|
10432
10466
|
},
|
|
10433
10467
|
{
|
|
10434
|
-
ref: `${AT$
|
|
10468
|
+
ref: `${AT$7}/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`,
|
|
10435
10469
|
rung: "implemented"
|
|
10436
10470
|
},
|
|
10437
10471
|
{
|
|
10438
|
-
ref: `${AT$
|
|
10472
|
+
ref: `${AT$7}/backend/tcop/postgres.c:4310-4316 the backend ignores SIGPIPE`,
|
|
10439
10473
|
rung: "implemented"
|
|
10440
10474
|
},
|
|
10441
10475
|
{
|
|
10442
|
-
ref: `${AT$
|
|
10476
|
+
ref: `${AT$7}/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`,
|
|
10443
10477
|
rung: "implemented"
|
|
10444
10478
|
},
|
|
10445
10479
|
{
|
|
10446
|
-
ref: `${AT$
|
|
10480
|
+
ref: `${AT$7}/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)`,
|
|
10447
10481
|
rung: "implemented"
|
|
10448
10482
|
},
|
|
10449
10483
|
{
|
|
10450
|
-
ref: `${AT$
|
|
10484
|
+
ref: `${AT$7}/backend/libpq/pqcomm.c:347-392 socket_close keeps the socket open until the process exits`,
|
|
10451
10485
|
rung: "implemented"
|
|
10452
10486
|
},
|
|
10453
10487
|
{
|
|
10454
|
-
ref: `${AT$
|
|
10488
|
+
ref: `${AT$7}/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`,
|
|
10455
10489
|
rung: "implemented"
|
|
10456
10490
|
},
|
|
10457
10491
|
{
|
|
10458
|
-
ref: `${AT$
|
|
10492
|
+
ref: `${AT$7}/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)`,
|
|
10459
10493
|
rung: "implemented"
|
|
10460
10494
|
},
|
|
10461
10495
|
{
|
|
10462
|
-
ref: `${AT$
|
|
10496
|
+
ref: `${AT$7}/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`,
|
|
10463
10497
|
rung: "implemented"
|
|
10464
10498
|
},
|
|
10465
10499
|
{
|
|
10466
|
-
ref: `${AT$
|
|
10500
|
+
ref: `${AT$7}/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`,
|
|
10467
10501
|
rung: "implemented"
|
|
10468
10502
|
},
|
|
10469
10503
|
{
|
|
@@ -11861,15 +11895,24 @@ const SUPAVISOR_SERVER = machineSchema.parse({
|
|
|
11861
11895
|
//#endregion
|
|
11862
11896
|
//#region src/procedures-ws.ts
|
|
11863
11897
|
/**
|
|
11864
|
-
* This module holds the machine documents of the WebSocket transport of `@procedures/client`
|
|
11865
|
-
*
|
|
11866
|
-
*
|
|
11867
|
-
*
|
|
11898
|
+
* This module holds the machine documents of the WebSocket transport of `@procedures/client` at
|
|
11899
|
+
* commit 2408cea of the client repository: 0.22.0 and two PATCHes after it. The WS and WST cells
|
|
11900
|
+
* run the subject that the client repository builds from that commit (CLI-33). Each fact comes
|
|
11901
|
+
* from the source of that commit, from `@mark1russell7/service` 0.5.8, from ws 8.22.0, or from Node
|
|
11902
|
+
* v24.21.0 and its undici 7.29.1. The comments and the sources give the file and the line.
|
|
11868
11903
|
*
|
|
11869
|
-
* The client repository has a document of the connection
|
|
11870
|
-
* `
|
|
11871
|
-
*
|
|
11904
|
+
* The client repository has a document of the connection: `WEBSOCKET_CONNECTION_MACHINE` in
|
|
11905
|
+
* `packages/client/src/machines.ts`. This document takes its states and its events, and the code
|
|
11906
|
+
* of the transports gives the timers.
|
|
11872
11907
|
*/
|
|
11908
|
+
/** This text is the folder of the WebSocket transports at the commit of the subject. */
|
|
11909
|
+
const AT$6 = "client 2408cea packages/client/src/adapters/websocket";
|
|
11910
|
+
/** This text is the client transport at that commit. */
|
|
11911
|
+
const CT = `${AT$6}/client/transport.ts`;
|
|
11912
|
+
/** This text is the server transport at that commit. */
|
|
11913
|
+
const ST = `${AT$6}/server/transport.ts`;
|
|
11914
|
+
/** This text is the source of the version of the service that the lock of the client gives (pnpm-lock.yaml:443-454). */
|
|
11915
|
+
const SERVICE = "@mark1russell7/service 0.5.8 (systems 571e9e5) packages/service/src";
|
|
11873
11916
|
/** This function gives the arithmetic of a duration in ms. */
|
|
11874
11917
|
const arithmetic = (duration) => {
|
|
11875
11918
|
if (!("expr" in duration) || duration.unit !== "ms") throw new Error("not arithmetic in ms");
|
|
@@ -11882,10 +11925,11 @@ const late = (ms) => arithmetic(nodeTimerLateness(ms));
|
|
|
11882
11925
|
/** This text is the early bound of one Node timer, in ms. */
|
|
11883
11926
|
const EARLY = arithmetic(NODE_TIMER_EARLY);
|
|
11884
11927
|
/**
|
|
11885
|
-
* This document is the connection of the WebSocket client of `@procedures/client` 0.
|
|
11886
|
-
* (`WebSocketTransport`), over its socket class and its Linux TCP socket.
|
|
11928
|
+
* This document is the connection of the WebSocket client of `@procedures/client` 0.22.0 at
|
|
11929
|
+
* commit 2408cea (`WebSocketTransport`), over its socket class and its Linux TCP socket. The
|
|
11930
|
+
* root entry uses the global `WebSocket` of Node, and `@procedures/client/node` uses the `ws` package.
|
|
11887
11931
|
*
|
|
11888
|
-
* - The heartbeat is `heartbeat()` of `@mark1russell7/service` 0.
|
|
11932
|
+
* - The heartbeat is `heartbeat()` of `@mark1russell7/service` 0.5.8. A tick each interval sends a
|
|
11889
11933
|
* ping only when no pong is awaited. The timeout of the ping starts before its send. A
|
|
11890
11934
|
* ping without a pong at its timeout is a miss, and `misses` misses in sequence drop the
|
|
11891
11935
|
* connection. With a timeout below the interval, each tick after a miss sends the next ping.
|
|
@@ -11901,12 +11945,12 @@ const EARLY = arithmetic(NODE_TIMER_EARLY);
|
|
|
11901
11945
|
const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
11902
11946
|
format: "mark1russell7.machine/1",
|
|
11903
11947
|
id: "procedures-ws-client",
|
|
11904
|
-
title: "The connection of the WebSocket client of @procedures/client 0.
|
|
11948
|
+
title: "The connection of the WebSocket client of @procedures/client 0.22.0 (client 2408cea)",
|
|
11905
11949
|
layer: "driver",
|
|
11906
|
-
version: "0.
|
|
11950
|
+
version: "0.22.0",
|
|
11907
11951
|
conditions: {
|
|
11908
|
-
"@procedures/client": "0.
|
|
11909
|
-
"@mark1russell7/service": "0.
|
|
11952
|
+
"@procedures/client": "0.22.0 (client 2408cea)",
|
|
11953
|
+
"@mark1russell7/service": "0.5.8",
|
|
11910
11954
|
node: "24.21.0",
|
|
11911
11955
|
undici: "7.29.1",
|
|
11912
11956
|
ws: "8.22.0",
|
|
@@ -11914,27 +11958,27 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
11914
11958
|
},
|
|
11915
11959
|
sources: [
|
|
11916
11960
|
{
|
|
11917
|
-
ref:
|
|
11961
|
+
ref: `${CT}:260-290 (the options: each time a duration, its default from TIMER_DEFAULTS.webSocketClient; the misses of the heartbeat at least 1 (:278); the jitter of the reconnect from 0 to 1 (:269); the class of the sockets (:289), used at :324)`,
|
|
11918
11962
|
rung: "implemented"
|
|
11919
11963
|
},
|
|
11920
11964
|
{
|
|
11921
|
-
ref:
|
|
11965
|
+
ref: `${CT}:486-511 startHeartbeat: heartbeat() of @mark1russell7/service with the interval, the timeout and the misses; a tick sends a ping only when CONNECTED (:498); the open starts it (:357-360)`,
|
|
11922
11966
|
rung: "implemented"
|
|
11923
11967
|
},
|
|
11924
11968
|
{
|
|
11925
|
-
ref:
|
|
11969
|
+
ref: `${SERVICE}/heartbeat.ts:129-135 (each tick starts the next one first), :96-127 (the timeout starts before the send of the ping, :110-114 and :117; a send that throws is a miss, :118-121), :81-94 (misses in sequence)`,
|
|
11926
11970
|
rung: "implemented"
|
|
11927
11971
|
},
|
|
11928
11972
|
{
|
|
11929
|
-
ref:
|
|
11973
|
+
ref: `${CT}:401-422 dropConnection: the handlers go (:128-134), terminate() when the class has it (:414-416), else close(), and handleClose at once (:421)`,
|
|
11930
11974
|
rung: "implemented"
|
|
11931
11975
|
},
|
|
11932
11976
|
{
|
|
11933
|
-
ref:
|
|
11977
|
+
ref: `${CT}:172-195 and :460-484: reconnectDelay is backoffDelay of @mark1russell7/service (${SERVICE}/backoff.ts:58-64), with a subtracted jitter; an open sets the attempts to 0 (:345)`,
|
|
11934
11978
|
rung: "implemented"
|
|
11935
11979
|
},
|
|
11936
11980
|
{
|
|
11937
|
-
ref:
|
|
11981
|
+
ref: `${CT}:330-339 and :389-392: the time limit of the handshake, and a failed handshake drops at once`,
|
|
11938
11982
|
rung: "implemented"
|
|
11939
11983
|
},
|
|
11940
11984
|
{
|
|
@@ -11942,15 +11986,15 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
11942
11986
|
rung: "implemented"
|
|
11943
11987
|
},
|
|
11944
11988
|
{
|
|
11945
|
-
ref: "ws 8.22.0 lib/websocket.js:
|
|
11989
|
+
ref: "ws 8.22.0 lib/websocket.js:500-517 terminate(): the socket is destroyed at once (:513-516), and a handshake is aborted (:507-511)",
|
|
11946
11990
|
rung: "implemented"
|
|
11947
11991
|
},
|
|
11948
11992
|
{
|
|
11949
|
-
ref:
|
|
11993
|
+
ref: `node v24.21.0 deps/undici/src/lib/core/connect.js:120-129 setKeepAlive(true, 60000); deps/uv/src/unix/tcp.c:591-593 uv_tcp_keepalive: 1 s and 10 probes. The ws package sets no keepalive on its socket (ws 8.22.0 lib/websocket.js:260-261), and the transport gives the class only the URL (${CT}:325, ${AT$6}/client/node.ts:30-34).`,
|
|
11950
11994
|
rung: "implemented"
|
|
11951
11995
|
},
|
|
11952
11996
|
{
|
|
11953
|
-
ref: "client
|
|
11997
|
+
ref: "client 2408cea packages/client/src/machines.ts:76-141 WEBSOCKET_CONNECTION_MACHINE: the states and the events of this document",
|
|
11954
11998
|
rung: "documented"
|
|
11955
11999
|
}
|
|
11956
12000
|
],
|
|
@@ -12184,7 +12228,7 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12184
12228
|
from: "CONNECTING",
|
|
12185
12229
|
on: "open",
|
|
12186
12230
|
to: "CONNECTED",
|
|
12187
|
-
source:
|
|
12231
|
+
source: `${CT}:342-361`
|
|
12188
12232
|
},
|
|
12189
12233
|
{
|
|
12190
12234
|
id: "pw.handshake-timeout",
|
|
@@ -12192,7 +12236,7 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12192
12236
|
on: "handshake-timeout",
|
|
12193
12237
|
to: "RECONNECTING",
|
|
12194
12238
|
timer: "handshake",
|
|
12195
|
-
source:
|
|
12239
|
+
source: `${CT}:330-339`
|
|
12196
12240
|
},
|
|
12197
12241
|
{
|
|
12198
12242
|
id: "pw.ping",
|
|
@@ -12201,7 +12245,7 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12201
12245
|
to: "AWAITING_PONG",
|
|
12202
12246
|
timer: "ping",
|
|
12203
12247
|
emits: ["tx.ping"],
|
|
12204
|
-
source:
|
|
12248
|
+
source: `${CT}:491-511`
|
|
12205
12249
|
},
|
|
12206
12250
|
{
|
|
12207
12251
|
id: "pw.skip",
|
|
@@ -12210,14 +12254,14 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12210
12254
|
to: "AWAITING_PONG",
|
|
12211
12255
|
timer: "ping",
|
|
12212
12256
|
note: "one ping at a time: the tick sends nothing",
|
|
12213
|
-
source:
|
|
12257
|
+
source: `${SERVICE}/heartbeat.ts:129-134`
|
|
12214
12258
|
},
|
|
12215
12259
|
{
|
|
12216
12260
|
id: "pw.pong",
|
|
12217
12261
|
from: "AWAITING_PONG",
|
|
12218
12262
|
on: "pong",
|
|
12219
12263
|
to: "CONNECTED",
|
|
12220
|
-
source:
|
|
12264
|
+
source: `${CT}:566-570`
|
|
12221
12265
|
},
|
|
12222
12266
|
{
|
|
12223
12267
|
id: "pw.pong-timeout",
|
|
@@ -12227,7 +12271,7 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12227
12271
|
timer: "pong",
|
|
12228
12272
|
emits: ["tx.close-frame"],
|
|
12229
12273
|
note: "dropConnection: terminate() destroys the socket of ws at once; close() of the global WebSocket writes a close frame, and its socket stays open below",
|
|
12230
|
-
source:
|
|
12274
|
+
source: `${CT}:401-422, :506-509`
|
|
12231
12275
|
},
|
|
12232
12276
|
{
|
|
12233
12277
|
id: "pw.drop",
|
|
@@ -12239,7 +12283,7 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12239
12283
|
on: "drop",
|
|
12240
12284
|
to: "RECONNECTING",
|
|
12241
12285
|
guard: "the reconnect is on, and tries are left",
|
|
12242
|
-
source:
|
|
12286
|
+
source: `${CT}:375-379, :436-458`
|
|
12243
12287
|
},
|
|
12244
12288
|
{
|
|
12245
12289
|
id: "pw.give-up",
|
|
@@ -12250,7 +12294,7 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12250
12294
|
],
|
|
12251
12295
|
on: "give-up",
|
|
12252
12296
|
to: "DISCONNECTED",
|
|
12253
|
-
source:
|
|
12297
|
+
source: `${CT}:444-445`
|
|
12254
12298
|
},
|
|
12255
12299
|
{
|
|
12256
12300
|
id: "pw.reconnect",
|
|
@@ -12258,7 +12302,7 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12258
12302
|
on: "reconnect-due",
|
|
12259
12303
|
to: "CONNECTING",
|
|
12260
12304
|
timer: "reconnect",
|
|
12261
|
-
source:
|
|
12305
|
+
source: `${CT}:463-484`
|
|
12262
12306
|
},
|
|
12263
12307
|
{
|
|
12264
12308
|
id: "pw.request-timeout",
|
|
@@ -12267,7 +12311,7 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12267
12311
|
to: "CONNECTED",
|
|
12268
12312
|
timer: "request",
|
|
12269
12313
|
errno: "TIMEOUT",
|
|
12270
|
-
source:
|
|
12314
|
+
source: `${CT}:724-733`
|
|
12271
12315
|
},
|
|
12272
12316
|
{
|
|
12273
12317
|
id: "pw.request-timeout-pinged",
|
|
@@ -12276,7 +12320,7 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12276
12320
|
to: "AWAITING_PONG",
|
|
12277
12321
|
timer: "request",
|
|
12278
12322
|
errno: "TIMEOUT",
|
|
12279
|
-
source:
|
|
12323
|
+
source: `${CT}:724-733`
|
|
12280
12324
|
},
|
|
12281
12325
|
{
|
|
12282
12326
|
id: "pw.close",
|
|
@@ -12323,8 +12367,9 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12323
12367
|
}
|
|
12324
12368
|
});
|
|
12325
12369
|
/**
|
|
12326
|
-
* This document is one connection as the WebSocket server of `@procedures/client` 0.
|
|
12327
|
-
* (`WebSocketServerTransport` on the `ws`
|
|
12370
|
+
* This document is one connection as the WebSocket server of `@procedures/client` 0.22.0 at
|
|
12371
|
+
* commit 2408cea holds it (`WebSocketServerTransport` of `@procedures/client/node`, on the `ws`
|
|
12372
|
+
* package), over its Linux TCP socket.
|
|
12328
12373
|
*
|
|
12329
12374
|
* The heartbeat of the server (roadmap R3) is a `setInterval`. Each beat pings each connection,
|
|
12330
12375
|
* and the server ends a connection after `misses` beats without a pong (`terminate()`). Thus the
|
|
@@ -12334,30 +12379,30 @@ const PROCEDURES_WS_CLIENT = machineSchema.parse({
|
|
|
12334
12379
|
const PROCEDURES_WS_SERVER = machineSchema.parse({
|
|
12335
12380
|
format: "mark1russell7.machine/1",
|
|
12336
12381
|
id: "procedures-ws-server",
|
|
12337
|
-
title: "One connection as the WebSocket server of @procedures/client 0.
|
|
12382
|
+
title: "One connection as the WebSocket server of @procedures/client 0.22.0 (client 2408cea) holds it",
|
|
12338
12383
|
layer: "server",
|
|
12339
|
-
version: "0.
|
|
12384
|
+
version: "0.22.0",
|
|
12340
12385
|
conditions: {
|
|
12341
|
-
"@procedures/client": "0.
|
|
12386
|
+
"@procedures/client": "0.22.0 (client 2408cea)",
|
|
12342
12387
|
ws: "8.22.0",
|
|
12343
12388
|
node: "24.21.0",
|
|
12344
12389
|
kernel: "Linux 6.6"
|
|
12345
12390
|
},
|
|
12346
12391
|
sources: [
|
|
12347
12392
|
{
|
|
12348
|
-
ref:
|
|
12393
|
+
ref: `${ST}:146-152 (the heartbeat: interval and misses, or false), :155-175 beat(): terminate after misses (:163-167), or count a miss and ping (:168-173); :232-236 setInterval of the interval; :429 a pong sets the misses to 0`,
|
|
12349
12394
|
rung: "implemented"
|
|
12350
12395
|
},
|
|
12351
12396
|
{
|
|
12352
|
-
ref: "
|
|
12397
|
+
ref: "client 2408cea packages/client/src/timers.ts:86-88 webSocketServer: heartbeatIntervalMs 15000, heartbeatMisses 2",
|
|
12353
12398
|
rung: "implemented"
|
|
12354
12399
|
},
|
|
12355
12400
|
{
|
|
12356
|
-
ref:
|
|
12401
|
+
ref: `${ST}:523-527: a ping of a client gets a pong`,
|
|
12357
12402
|
rung: "implemented"
|
|
12358
12403
|
},
|
|
12359
12404
|
{
|
|
12360
|
-
ref:
|
|
12405
|
+
ref: `node v24.21.0 lib/_http_server.js:646-651 and lib/net.js:2753-2756: keepAlive of http.Server is off at the default, thus an accepted socket has no SO_KEEPALIVE. The transport takes the upgrades of the server of its host (${ST}:187-230) and sets no option of a socket`,
|
|
12361
12406
|
rung: "implemented"
|
|
12362
12407
|
}
|
|
12363
12408
|
],
|
|
@@ -12462,7 +12507,7 @@ const PROCEDURES_WS_SERVER = machineSchema.parse({
|
|
|
12462
12507
|
on: "rx.ping",
|
|
12463
12508
|
to: "OPEN",
|
|
12464
12509
|
emits: ["tx.pong"],
|
|
12465
|
-
source:
|
|
12510
|
+
source: `${ST}:523-527`
|
|
12466
12511
|
},
|
|
12467
12512
|
{
|
|
12468
12513
|
id: "ps.terminate",
|
|
@@ -12471,7 +12516,7 @@ const PROCEDURES_WS_SERVER = machineSchema.parse({
|
|
|
12471
12516
|
to: "CLOSED",
|
|
12472
12517
|
timer: "heartbeat",
|
|
12473
12518
|
emits: ["tx.fin"],
|
|
12474
|
-
source:
|
|
12519
|
+
source: `${ST}:163-167`
|
|
12475
12520
|
},
|
|
12476
12521
|
{
|
|
12477
12522
|
id: "ps.close",
|