@mark1russell7/machines 0.3.13 → 0.3.15

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/build/index.js CHANGED
@@ -1349,7 +1349,7 @@ const UNDICI_CLIENT = machineSchema.parse({
1349
1349
  });
1350
1350
  //#endregion
1351
1351
  //#region src/ioredis-sentinel.ts
1352
- const AT$6 = "ioredis 6.0.0 built";
1352
+ const AT$7 = "ioredis 6.0.0 built";
1353
1353
  /**
1354
1354
  * This document is the Sentinel path of ioredis 6.0.0. It tells how ioredis finds the primary of a
1355
1355
  * group through the Sentinels, loses it, and connects to the new one. The standalone states of
@@ -1370,43 +1370,43 @@ const IOREDIS_SENTINEL = machineSchema.parse({
1370
1370
  },
1371
1371
  sources: [
1372
1372
  {
1373
- ref: `${AT$6}/connectors/SentinelConnector/index.js:46-121 connect (each Sentinel in turn, then sentinelRetryStrategy)`,
1373
+ ref: `${AT$7}/connectors/SentinelConnector/index.js:46-121 connect (each Sentinel in turn, then sentinelRetryStrategy)`,
1374
1374
  rung: "implemented"
1375
1375
  },
1376
1376
  {
1377
- ref: `${AT$6}/connectors/SentinelConnector/index.js:145-151 resolveMaster (get-master-addr-by-name, then SENTINEL sentinels)`,
1377
+ ref: `${AT$7}/connectors/SentinelConnector/index.js:145-151 resolveMaster (get-master-addr-by-name, then SENTINEL sentinels)`,
1378
1378
  rung: "implemented"
1379
1379
  },
1380
1380
  {
1381
- ref: `${AT$6}/connectors/SentinelConnector/index.js:175-212 connectToSentinel and resolve (one connection for each question, no retry)`,
1381
+ ref: `${AT$7}/connectors/SentinelConnector/index.js:175-212 connectToSentinel and resolve (one connection for each question, no retry)`,
1382
1382
  rung: "implemented"
1383
1383
  },
1384
1384
  {
1385
- ref: `${AT$6}/connectors/SentinelConnector/index.js:27-39 check (the role of the ready check)`,
1385
+ ref: `${AT$7}/connectors/SentinelConnector/index.js:27-39 check (the role of the ready check)`,
1386
1386
  rung: "implemented"
1387
1387
  },
1388
1388
  {
1389
- ref: `${AT$6}/connectors/SentinelConnector/FailoverDetector.js:6-43 (+switch-master, only with failoverDetector)`,
1389
+ ref: `${AT$7}/connectors/SentinelConnector/FailoverDetector.js:6-43 (+switch-master, only with failoverDetector)`,
1390
1390
  rung: "implemented"
1391
1391
  },
1392
1392
  {
1393
- ref: `${AT$6}/redis/RedisOptions.js:9-57 (the defaults)`,
1393
+ ref: `${AT$7}/redis/RedisOptions.js:9-57 (the defaults)`,
1394
1394
  rung: "implemented"
1395
1395
  },
1396
1396
  {
1397
- ref: `${AT$6}/redis/event_handler.js:294-355 closeHandler (retryStrategy, then maxRetriesPerRequest flushes the queue)`,
1397
+ ref: `${AT$7}/redis/event_handler.js:294-355 closeHandler (retryStrategy, then maxRetriesPerRequest flushes the queue)`,
1398
1398
  rung: "implemented"
1399
1399
  },
1400
1400
  {
1401
- ref: `${AT$6}/redis/event_handler.js:364-449 readyHandler (retryAttempts back to 0, the resend, the offline queue)`,
1401
+ ref: `${AT$7}/redis/event_handler.js:364-449 readyHandler (retryAttempts back to 0, the resend, the offline queue)`,
1402
1402
  rung: "implemented"
1403
1403
  },
1404
1404
  {
1405
- ref: `${AT$6}/Redis.js:123-240 _connect (connectTimeout, keepAlive) and :379-405 sendCommand (the offline queue)`,
1405
+ ref: `${AT$7}/Redis.js:123-240 _connect (connectTimeout, keepAlive) and :379-405 sendCommand (the offline queue)`,
1406
1406
  rung: "implemented"
1407
1407
  },
1408
1408
  {
1409
- ref: `${AT$6}/Redis.js:599-605 handleReconnection (reconnectOnError: null, thus a READONLY error goes to the caller)`,
1409
+ ref: `${AT$7}/Redis.js:599-605 handleReconnection (reconnectOnError: null, thus a READONLY error goes to the caller)`,
1410
1410
  rung: "implemented"
1411
1411
  }
1412
1412
  ],
@@ -3566,7 +3566,7 @@ const IOREDIS_STATUS = machineSchema.parse(ioredis_status_default);
3566
3566
  const MANIFESTATIONS = z.record(z.string(), z.array(z.string())).parse(manifestations_default);
3567
3567
  //#endregion
3568
3568
  //#region src/mongo/mongod-replication.ts
3569
- const AT$5 = "mongodb r9.0.4 src/mongo/db/repl";
3569
+ const AT$6 = "mongodb r9.0.4 src/mongo/db/repl";
3570
3570
  /**
3571
3571
  * This document is the replication of mongod 9.0.4. It gives one member of a replica set, its view
3572
3572
  * of the primary, and the election that it can hold. The states are the states of the member. The
@@ -3597,95 +3597,95 @@ const MONGOD_REPL = machineSchema.parse({
3597
3597
  },
3598
3598
  sources: [
3599
3599
  {
3600
- ref: `${AT$5}/repl_set_config.idl:74-109 the settings: heartbeatIntervalMillis 2000, heartbeatTimeoutSecs 10, electionTimeoutMillis 10000, catchUpTimeoutMillis -1, catchUpTakeoverDelayMillis 30000`,
3600
+ ref: `${AT$6}/repl_set_config.idl:74-109 the settings: heartbeatIntervalMillis 2000, heartbeatTimeoutSecs 10, electionTimeoutMillis 10000, catchUpTimeoutMillis -1, catchUpTakeoverDelayMillis 30000`,
3601
3601
  rung: "implemented"
3602
3602
  },
3603
3603
  {
3604
- ref: `${AT$5}/repl_server_parameters.idl:320-328 replElectionTimeoutOffsetLimitFraction 0.15`,
3604
+ ref: `${AT$6}/repl_server_parameters.idl:320-328 replElectionTimeoutOffsetLimitFraction 0.15`,
3605
3605
  rung: "implemented"
3606
3606
  },
3607
3607
  {
3608
- ref: `${AT$5}/topology_coordinator.cpp:1058-1101 the heartbeat window and the timeout of each request, :1124-1147 the next heartbeat, :1239-1248 a member DOWN`,
3608
+ ref: `${AT$6}/topology_coordinator.cpp:1058-1101 the heartbeat window and the timeout of each request, :1124-1147 the next heartbeat, :1239-1248 a member DOWN`,
3609
3609
  rung: "implemented"
3610
3610
  },
3611
3611
  {
3612
- ref: `${AT$5}/topology_coordinator.h:62 kMaxHeartbeatRetries 2`,
3612
+ ref: `${AT$6}/topology_coordinator.h:62 kMaxHeartbeatRetries 2`,
3613
3613
  rung: "implemented"
3614
3614
  },
3615
3615
  {
3616
- ref: `${AT$5}/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`,
3616
+ ref: `${AT$6}/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`,
3617
3617
  rung: "implemented"
3618
3618
  },
3619
3619
  {
3620
- ref: `${AT$5}/data_replicator_external_state_impl.cpp:70-81 an oplog batch that names a primary postpones the election`,
3620
+ ref: `${AT$6}/data_replicator_external_state_impl.cpp:70-81 an oplog batch that names a primary postpones the election`,
3621
3621
  rung: "implemented"
3622
3622
  },
3623
3623
  {
3624
- ref: `${AT$5}/delayable_timeout_callback.cpp:149-172 the offset changes at most once in its own length`,
3624
+ ref: `${AT$6}/delayable_timeout_callback.cpp:149-172 the offset changes at most once in its own length`,
3625
3625
  rung: "implemented"
3626
3626
  },
3627
3627
  {
3628
- ref: `${AT$5}/topology_coordinator.cpp:1440-1457 and :1476-1489 the liveness check: a primary that cannot see a majority steps down`,
3628
+ ref: `${AT$6}/topology_coordinator.cpp:1440-1457 and :1476-1489 the liveness check: a primary that cannot see a majority steps down`,
3629
3629
  rung: "implemented"
3630
3630
  },
3631
3631
  {
3632
- ref: `${AT$5}/replication_coordinator_impl_heartbeat.cpp:1158-1188 the liveness check runs at the stalest member's last update plus the election timeout`,
3632
+ ref: `${AT$6}/replication_coordinator_impl_heartbeat.cpp:1158-1188 the liveness check runs at the stalest member's last update plus the election timeout`,
3633
3633
  rung: "implemented"
3634
3634
  },
3635
3635
  {
3636
- ref: `${AT$5}/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`,
3636
+ ref: `${AT$6}/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`,
3637
3637
  rung: "implemented"
3638
3638
  },
3639
3639
  {
3640
- ref: `${AT$5}/vote_requester.cpp:96 a vote request times out at min(electionTimeoutMillis, 30 s), :160-177 a majority of yes votes ends the round`,
3640
+ ref: `${AT$6}/vote_requester.cpp:96 a vote request times out at min(electionTimeoutMillis, 30 s), :160-177 a majority of yes votes ends the round`,
3641
3641
  rung: "implemented"
3642
3642
  },
3643
3643
  {
3644
- ref: `${AT$5}/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`,
3644
+ ref: `${AT$6}/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`,
3645
3645
  rung: "implemented"
3646
3646
  },
3647
3647
  {
3648
- ref: `${AT$5}/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`,
3648
+ ref: `${AT$6}/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`,
3649
3649
  rung: "implemented"
3650
3650
  },
3651
3651
  {
3652
- ref: `${AT$5}/topology_coordinator.cpp:3841-3849 and :3910-3932 a restarted heartbeat, and the latest optime that the catch-up waits for`,
3652
+ ref: `${AT$6}/topology_coordinator.cpp:3841-3849 and :3910-3932 a restarted heartbeat, and the latest optime that the catch-up waits for`,
3653
3653
  rung: "implemented"
3654
3654
  },
3655
3655
  {
3656
- ref: `${AT$5}/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`,
3656
+ ref: `${AT$6}/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`,
3657
3657
  rung: "implemented"
3658
3658
  },
3659
3659
  {
3660
- ref: `${AT$5}/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`,
3660
+ ref: `${AT$6}/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`,
3661
3661
  rung: "implemented"
3662
3662
  },
3663
3663
  {
3664
- ref: `${AT$5}/repl_set_commands.cpp:545-561 stepDownSecs 60 and secondaryCatchUpPeriodSecs 10`,
3664
+ ref: `${AT$6}/repl_set_commands.cpp:545-561 stepDownSecs 60 and secondaryCatchUpPeriodSecs 10`,
3665
3665
  rung: "implemented"
3666
3666
  },
3667
3667
  {
3668
- ref: `${AT$5}/replication_coordinator_impl.idl:18-26 enableElectionHandoff true, and replication_coordinator_impl.cpp:2830-2873 the hand-off: replSetStepUp with skipDryRun`,
3668
+ ref: `${AT$6}/replication_coordinator_impl.idl:18-26 enableElectionHandoff true, and replication_coordinator_impl.cpp:2830-2873 the hand-off: replSetStepUp with skipDryRun`,
3669
3669
  rung: "implemented"
3670
3670
  },
3671
3671
  {
3672
- ref: `${AT$5}/replication_coordinator_impl.cpp:1516 the reconfig of the term, :4598 and :4750 a new config starts each heartbeat again`,
3672
+ ref: `${AT$6}/replication_coordinator_impl.cpp:1516 the reconfig of the term, :4598 and :4750 a new config starts each heartbeat again`,
3673
3673
  rung: "implemented"
3674
3674
  },
3675
3675
  {
3676
- ref: `${AT$5}/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`,
3676
+ ref: `${AT$6}/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`,
3677
3677
  rung: "implemented"
3678
3678
  },
3679
3679
  {
3680
- ref: `${AT$5}/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`,
3680
+ ref: `${AT$6}/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`,
3681
3681
  rung: "implemented"
3682
3682
  },
3683
3683
  {
3684
- ref: `${AT$5}/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`,
3684
+ ref: `${AT$6}/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`,
3685
3685
  rung: "implemented"
3686
3686
  },
3687
3687
  {
3688
- ref: `${AT$5}/repl_server_parameters.idl:121-126 oplogRetriedFindMaxSeconds 2, :234-244 oplogFetcherSteadyStateMaxFetcherRestarts 1, :344-351 oplogNetworkTimeoutBufferSeconds 5`,
3688
+ ref: `${AT$6}/repl_server_parameters.idl:121-126 oplogRetriedFindMaxSeconds 2, :234-244 oplogFetcherSteadyStateMaxFetcherRestarts 1, :344-351 oplogNetworkTimeoutBufferSeconds 5`,
3689
3689
  rung: "implemented"
3690
3690
  },
3691
3691
  {
@@ -3693,19 +3693,19 @@ const MONGOD_REPL = machineSchema.parse({
3693
3693
  rung: "implemented"
3694
3694
  },
3695
3695
  {
3696
- ref: `${AT$5}/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`,
3696
+ ref: `${AT$6}/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`,
3697
3697
  rung: "implemented"
3698
3698
  },
3699
3699
  {
3700
- ref: `${AT$5}/replication_coordinator_impl.cpp:4947-4972 a member that loses its sync source starts each heartbeat again at once`,
3700
+ ref: `${AT$6}/replication_coordinator_impl.cpp:4947-4972 a member that loses its sync source starts each heartbeat again at once`,
3701
3701
  rung: "implemented"
3702
3702
  },
3703
3703
  {
3704
- ref: `${AT$5}/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`,
3704
+ ref: `${AT$6}/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`,
3705
3705
  rung: "implemented"
3706
3706
  },
3707
3707
  {
3708
- ref: `${AT$5}/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`,
3708
+ ref: `${AT$6}/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`,
3709
3709
  rung: "implemented"
3710
3710
  },
3711
3711
  {
@@ -4324,7 +4324,7 @@ const MONGOD_REPL = machineSchema.parse({
4324
4324
  });
4325
4325
  //#endregion
4326
4326
  //#region src/mongo/mongod-session.ts
4327
- const AT$4 = "mongodb r9.0.4 src/mongo";
4327
+ const AT$5 = "mongodb r9.0.4 src/mongo";
4328
4328
  /**
4329
4329
  * This document is the hold of mongod 9.0.4 on one client connection, over its socket. `mongod`
4330
4330
  * turns keepalive on for each TCP session. It lowers two keepalive options of the socket to a
@@ -4351,27 +4351,27 @@ const MONGOD_SESSION = machineSchema.parse({
4351
4351
  },
4352
4352
  sources: [
4353
4353
  {
4354
- ref: `${AT$4}/transport/asio/asio_session_impl.cpp:156-165 each TCP session: TCP_NODELAY, SO_KEEPALIVE, setSocketKeepAliveParams, failures at debug 3 in a release build`,
4354
+ ref: `${AT$5}/transport/asio/asio_session_impl.cpp:156-165 each TCP session: TCP_NODELAY, SO_KEEPALIVE, setSocketKeepAliveParams, failures at debug 3 in a release build`,
4355
4355
  rung: "implemented"
4356
4356
  },
4357
4357
  {
4358
- ref: `${AT$4}/util/net/socket_utils.h:15-16 kMaxKeepIdleSecs 300 and kMaxKeepIntvlSecs 1, :19-22 the defaults of setSocketKeepAliveParams`,
4358
+ ref: `${AT$5}/util/net/socket_utils.h:15-16 kMaxKeepIdleSecs 300 and kMaxKeepIntvlSecs 1, :19-22 the defaults of setSocketKeepAliveParams`,
4359
4359
  rung: "implemented"
4360
4360
  },
4361
4361
  {
4362
- ref: `${AT$4}/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`,
4362
+ ref: `${AT$5}/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`,
4363
4363
  rung: "implemented"
4364
4364
  },
4365
4365
  {
4366
- ref: `${AT$4}/util/net/socket_utils.cpp:176-181 and :190-194 the log of a failed read or set, at the severity of the caller`,
4366
+ ref: `${AT$5}/util/net/socket_utils.cpp:176-181 and :190-194 the log of a failed read or set, at the severity of the caller`,
4367
4367
  rung: "implemented"
4368
4368
  },
4369
4369
  {
4370
- ref: `${AT$4}/util/net/sock.cpp:135-142 the older socket path: SO_KEEPALIVE, then the same maximums, failures as errors`,
4370
+ ref: `${AT$5}/util/net/sock.cpp:135-142 the older socket path: SO_KEEPALIVE, then the same maximums, failures as errors`,
4371
4371
  rung: "implemented"
4372
4372
  },
4373
4373
  {
4374
- ref: `${AT$4}/db/repl/replication_info.cpp:131-143 an awaitable hello waits until now + maxAwaitTimeMS on the precise clock, or a change of the topology`,
4374
+ ref: `${AT$5}/db/repl/replication_info.cpp:131-143 an awaitable hello waits until now + maxAwaitTimeMS on the precise clock, or a change of the topology`,
4375
4375
  rung: "implemented"
4376
4376
  }
4377
4377
  ],
@@ -4533,7 +4533,7 @@ const MONGOD_SESSION = machineSchema.parse({
4533
4533
  });
4534
4534
  //#endregion
4535
4535
  //#region src/mongo/mongodb-node.ts
4536
- const AT$3 = "mongodb 7.7.0 src";
4536
+ const AT$4 = "mongodb 7.7.0 src";
4537
4537
  /**
4538
4538
  * This document is the MongoDB Node driver 7.7.0, for one server of a replica set. It gives one
4539
4539
  * connection of the driver by its role, and the timers that act on it. The roles are the monitor
@@ -4560,75 +4560,75 @@ const MONGODB_NODE = machineSchema.parse({
4560
4560
  },
4561
4561
  sources: [
4562
4562
  {
4563
- ref: `${AT$3}/connection_string.ts:804-807 connectTimeoutMS 30000, :850-853 heartbeatFrequencyMS 10000, :934-937 minHeartbeatFrequencyMS 500`,
4563
+ ref: `${AT$4}/connection_string.ts:804-807 connectTimeoutMS 30000, :850-853 heartbeatFrequencyMS 10000, :934-937 minHeartbeatFrequencyMS 500`,
4564
4564
  rung: "implemented"
4565
4565
  },
4566
4566
  {
4567
- ref: `${AT$3}/connection_string.ts:1100-1103 serverSelectionTimeoutMS 30000, :1107-1111 socketTimeoutMS 0, :1178-1182 waitQueueTimeoutMS 0`,
4567
+ ref: `${AT$4}/connection_string.ts:1100-1103 serverSelectionTimeoutMS 30000, :1107-1111 socketTimeoutMS 0, :1178-1182 waitQueueTimeoutMS 0`,
4568
4568
  rung: "implemented"
4569
4569
  },
4570
4570
  {
4571
- ref: `${AT$3}/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`,
4571
+ ref: `${AT$4}/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`,
4572
4572
  rung: "implemented"
4573
4573
  },
4574
4574
  {
4575
- ref: `${AT$3}/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`,
4575
+ ref: `${AT$4}/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`,
4576
4576
  rung: "implemented"
4577
4577
  },
4578
4578
  {
4579
- ref: `${AT$3}/cmap/connect.ts:117-120 the handshake reads with socketTimeoutMS = connectTimeoutMS`,
4579
+ ref: `${AT$4}/cmap/connect.ts:117-120 the handshake reads with socketTimeoutMS = connectTimeoutMS`,
4580
4580
  rung: "implemented"
4581
4581
  },
4582
4582
  {
4583
- ref: `${AT$3}/sdam/monitor.ts:245-259 the streaming protocol, :338-371 the awaitable hello: maxAwaitTimeMS = heartbeatFrequencyMS, socketTimeoutMS = connectTimeoutMS + maxAwaitTimeMS`,
4583
+ ref: `${AT$4}/sdam/monitor.ts:245-259 the streaming protocol, :338-371 the awaitable hello: maxAwaitTimeMS = heartbeatFrequencyMS, socketTimeoutMS = connectTimeoutMS + maxAwaitTimeMS`,
4584
4584
  rung: "implemented"
4585
4585
  },
4586
4586
  {
4587
- ref: `${AT$3}/sdam/monitor.ts:273-293 a failed heartbeat: ResetPool, and InterruptInUseConnections for a timeout`,
4587
+ ref: `${AT$4}/sdam/monitor.ts:273-293 a failed heartbeat: ResetPool, and InterruptInUseConnections for a timeout`,
4588
4588
  rung: "implemented"
4589
4589
  },
4590
4590
  {
4591
- ref: `${AT$3}/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`,
4591
+ ref: `${AT$4}/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`,
4592
4592
  rung: "implemented"
4593
4593
  },
4594
4594
  {
4595
- ref: `${AT$3}/sdam/monitor.ts:490-565 the RTT pinger: its own connection, a hello each heartbeatFrequencyMS, no socket timeout`,
4595
+ ref: `${AT$4}/sdam/monitor.ts:490-565 the RTT pinger: its own connection, a hello each heartbeatFrequencyMS, no socket timeout`,
4596
4596
  rung: "implemented"
4597
4597
  },
4598
4598
  {
4599
- ref: `${AT$3}/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`,
4599
+ ref: `${AT$4}/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`,
4600
4600
  rung: "implemented"
4601
4601
  },
4602
4602
  {
4603
- ref: `${AT$3}/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`,
4603
+ ref: `${AT$4}/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`,
4604
4604
  rung: "implemented"
4605
4605
  },
4606
4606
  {
4607
- ref: `${AT$3}/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`,
4607
+ ref: `${AT$4}/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`,
4608
4608
  rung: "implemented"
4609
4609
  },
4610
4610
  {
4611
- ref: `${AT$3}/sdam/topology_description.ts:458-467 a primary that another primary replaces is Unknown, and nothing clears its pool`,
4611
+ ref: `${AT$4}/sdam/topology_description.ts:458-467 a primary that another primary replaces is Unknown, and nothing clears its pool`,
4612
4612
  rung: "implemented"
4613
4613
  },
4614
4614
  {
4615
- ref: `${AT$3}/cmap/connection_pool.ts:417-468 clear, :475-481 interruptInUseConnections: PoolClearedOnNetworkError, :584 a connection idle for maxIdleTimeMS is perished at the next check-out`,
4615
+ ref: `${AT$4}/cmap/connection_pool.ts:417-468 clear, :475-481 interruptInUseConnections: PoolClearedOnNetworkError, :584 a connection idle for maxIdleTimeMS is perished at the next check-out`,
4616
4616
  rung: "implemented"
4617
4617
  },
4618
4618
  {
4619
- ref: `${AT$3}/cmap/errors.ts:37-84 PoolClearedError and PoolClearedOnNetworkError, with the label PoolRequestedRetry`,
4619
+ ref: `${AT$4}/cmap/errors.ts:37-84 PoolClearedError and PoolClearedOnNetworkError, with the label PoolRequestedRetry`,
4620
4620
  rung: "implemented"
4621
4621
  },
4622
4622
  {
4623
- ref: `${AT$3}/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`,
4623
+ ref: `${AT$4}/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`,
4624
4624
  rung: "implemented"
4625
4625
  },
4626
4626
  {
4627
- ref: `${AT$3}/error.ts:1377-1394 the retryable codes, :1431-1436 isRetryableWriteError: RetryableWriteError or PoolRequestedRetry`,
4627
+ ref: `${AT$4}/error.ts:1377-1394 the retryable codes, :1431-1436 isRetryableWriteError: RetryableWriteError or PoolRequestedRetry`,
4628
4628
  rung: "implemented"
4629
4629
  },
4630
4630
  {
4631
- ref: `${AT$3}/timeout.ts:362-372 the legacy timeout context: the selection timeout, and no check-out timeout at waitQueueTimeoutMS 0`,
4631
+ ref: `${AT$4}/timeout.ts:362-372 the legacy timeout context: the selection timeout, and no check-out timeout at waitQueueTimeoutMS 0`,
4632
4632
  rung: "implemented"
4633
4633
  },
4634
4634
  {
@@ -6308,7 +6308,7 @@ const HIKARICP_PGJDBC = machineSchema.parse({
6308
6308
  });
6309
6309
  //#endregion
6310
6310
  //#region src/pg/node-postgres.ts
6311
- const AT$2 = "pg 8.23.1 lib";
6311
+ const AT$3 = "pg 8.23.1 lib";
6312
6312
  const POOL = "pg-pool 3.14.0";
6313
6313
  /**
6314
6314
  * This document is node-postgres 8.23.1 (the npm package pg) with pg-pool 3.14.0, for one client
@@ -6350,75 +6350,75 @@ const NODE_POSTGRES = machineSchema.parse({
6350
6350
  rung: "implemented"
6351
6351
  },
6352
6352
  {
6353
- ref: `${AT$2}/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`,
6353
+ ref: `${AT$3}/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`,
6354
6354
  rung: "implemented"
6355
6355
  },
6356
6356
  {
6357
- ref: `${AT$2}/defaults.js:65, :69, :73 and :76 statement_timeout, lock_timeout, idle_in_transaction_session_timeout and query_timeout are false`,
6357
+ ref: `${AT$3}/defaults.js:65, :69, :73 and :76 statement_timeout, lock_timeout, idle_in_transaction_session_timeout and query_timeout are false`,
6358
6358
  rung: "implemented"
6359
6359
  },
6360
6360
  {
6361
- ref: `${AT$2}/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`,
6361
+ ref: `${AT$3}/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`,
6362
6362
  rung: "documented"
6363
6363
  },
6364
6364
  {
6365
- ref: `${AT$2}/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`,
6365
+ ref: `${AT$3}/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`,
6366
6366
  rung: "implemented"
6367
6367
  },
6368
6368
  {
6369
- ref: `${AT$2}/client.js:89-98 the Connection gets keepAlive false and keepAliveInitialDelayMillis 0 when the config does not give them, :116 connectionTimeoutMillis 0`,
6369
+ ref: `${AT$3}/client.js:89-98 the Connection gets keepAlive false and keepAliveInitialDelayMillis 0 when the config does not give them, :116 connectionTimeoutMillis 0`,
6370
6370
  rung: "implemented"
6371
6371
  },
6372
6372
  {
6373
- ref: `${AT$2}/stream.js:20-24 and :78-83 outside Cloudflare Workers, the socket is a new net.Socket with no option`,
6373
+ ref: `${AT$3}/stream.js:20-24 and :78-83 outside Cloudflare Workers, the socket is a new net.Socket with no option`,
6374
6374
  rung: "implemented"
6375
6375
  },
6376
6376
  {
6377
- ref: `${AT$2}/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`,
6377
+ ref: `${AT$3}/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`,
6378
6378
  rung: "implemented"
6379
6379
  },
6380
6380
  {
6381
- ref: `${AT$2}/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`,
6381
+ ref: `${AT$3}/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`,
6382
6382
  rung: "implemented"
6383
6383
  },
6384
6384
  {
6385
- ref: `${AT$2}/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`,
6385
+ ref: `${AT$3}/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`,
6386
6386
  rung: "implemented"
6387
6387
  },
6388
6388
  {
6389
- ref: `${AT$2}/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`,
6389
+ ref: `${AT$3}/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`,
6390
6390
  rung: "implemented"
6391
6391
  },
6392
6392
  {
6393
- ref: `${AT$2}/client.js:426-442 an ErrorResponse fails the active query only, and with no active query it is an error of the client`,
6393
+ ref: `${AT$3}/client.js:426-442 an ErrorResponse fails the active query only, and with no active query it is an error of the client`,
6394
6394
  rung: "implemented"
6395
6395
  },
6396
6396
  {
6397
- ref: `${AT$2}/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`,
6397
+ ref: `${AT$3}/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`,
6398
6398
  rung: "implemented"
6399
6399
  },
6400
6400
  {
6401
- ref: `${AT$2}/client.js:133-151 _errorAllQueries: each query of the client fails with the same error, on the next tick`,
6401
+ ref: `${AT$3}/client.js:133-151 _errorAllQueries: each query of the client fails with the same error, on the next tick`,
6402
6402
  rung: "implemented"
6403
6403
  },
6404
6404
  {
6405
- ref: `${AT$2}/query.js:122-150 a query gives its error or its result to its callback, at the error or at the ReadyForQuery`,
6405
+ ref: `${AT$3}/query.js:122-150 a query gives its error or its result to its callback, at the error or at the ReadyForQuery`,
6406
6406
  rung: "implemented"
6407
6407
  },
6408
6408
  {
6409
- ref: `${AT$2}/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`,
6409
+ ref: `${AT$3}/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`,
6410
6410
  rung: "implemented"
6411
6411
  },
6412
6412
  {
6413
- ref: `${AT$2}/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`,
6413
+ ref: `${AT$3}/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`,
6414
6414
  rung: "implemented"
6415
6415
  },
6416
6416
  {
6417
- ref: `${AT$2}/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`,
6417
+ ref: `${AT$3}/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`,
6418
6418
  rung: "implemented"
6419
6419
  },
6420
6420
  {
6421
- ref: `${AT$2}/client.js:543-572 getStartupConf: statement_timeout, lock_timeout and idle_in_transaction_session_timeout go to the server only when they are set`,
6421
+ ref: `${AT$3}/client.js:543-572 getStartupConf: statement_timeout, lock_timeout and idle_in_transaction_session_timeout go to the server only when they are set`,
6422
6422
  rung: "implemented"
6423
6423
  },
6424
6424
  {
@@ -8814,7 +8814,7 @@ const PGPOOL_SESSION = machineSchema.parse({
8814
8814
  });
8815
8815
  //#endregion
8816
8816
  //#region src/pg/postgres-session.ts
8817
- const AT$1 = "postgresql REL_17_11 src";
8817
+ const AT$2 = "postgresql REL_17_11 src";
8818
8818
  const DOC = "postgresql REL_17_11 doc/src/sgml";
8819
8819
  /**
8820
8820
  * This document is the hold of a PostgreSQL 17.11 backend on one client connection, over its TCP
@@ -8854,163 +8854,163 @@ const POSTGRES_SESSION = machineSchema.parse({
8854
8854
  rung: "implemented"
8855
8855
  },
8856
8856
  {
8857
- ref: `${AT$1}/backend/tcop/backend_startup.c:157-161 BackendInitialize calls pq_init in the backend, before the startup packet`,
8857
+ ref: `${AT$2}/backend/tcop/backend_startup.c:157-161 BackendInitialize calls pq_init in the backend, before the startup packet`,
8858
8858
  rung: "implemented"
8859
8859
  },
8860
8860
  {
8861
- ref: `${AT$1}/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`,
8861
+ ref: `${AT$2}/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`,
8862
8862
  rung: "implemented"
8863
8863
  },
8864
8864
  {
8865
- ref: `${AT$1}/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`,
8865
+ ref: `${AT$2}/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`,
8866
8866
  rung: "implemented"
8867
8867
  },
8868
8868
  {
8869
- ref: `${AT$1}/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`,
8869
+ ref: `${AT$2}/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`,
8870
8870
  rung: "implemented"
8871
8871
  },
8872
8872
  {
8873
- ref: `${AT$1}/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`,
8873
+ ref: `${AT$2}/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`,
8874
8874
  rung: "implemented"
8875
8875
  },
8876
8876
  {
8877
- ref: `${AT$1}/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`,
8877
+ ref: `${AT$2}/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`,
8878
8878
  rung: "implemented"
8879
8879
  },
8880
8880
  {
8881
- ref: `${AT$1}/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`,
8881
+ ref: `${AT$2}/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`,
8882
8882
  rung: "implemented"
8883
8883
  },
8884
8884
  {
8885
- ref: `${AT$1}/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`,
8885
+ ref: `${AT$2}/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`,
8886
8886
  rung: "implemented"
8887
8887
  },
8888
8888
  {
8889
- ref: `${AT$1}/include/utils/timeout.h:3-4 and :23-43 one SIGALRM for each timeout id, STARTUP_PACKET_TIMEOUT to CLIENT_CONNECTION_CHECK_TIMEOUT`,
8889
+ ref: `${AT$2}/include/utils/timeout.h:3-4 and :23-43 one SIGALRM for each timeout id, STARTUP_PACKET_TIMEOUT to CLIENT_CONNECTION_CHECK_TIMEOUT`,
8890
8890
  rung: "implemented"
8891
8891
  },
8892
8892
  {
8893
- ref: `${AT$1}/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`,
8893
+ ref: `${AT$2}/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`,
8894
8894
  rung: "implemented"
8895
8895
  },
8896
8896
  {
8897
- ref: `${AT$1}/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`,
8897
+ ref: `${AT$2}/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`,
8898
8898
  rung: "implemented"
8899
8899
  },
8900
8900
  {
8901
- ref: `${AT$1}/backend/tcop/postgres.c:2999-3023 die (SIGTERM) sets ProcDiePending, :3029-3043 StatementCancelHandler (SIGINT) sets QueryCancelPending, :4292-4294 the two handlers`,
8901
+ ref: `${AT$2}/backend/tcop/postgres.c:2999-3023 die (SIGTERM) sets ProcDiePending, :3029-3043 StatementCancelHandler (SIGINT) sets QueryCancelPending, :4292-4294 the two handlers`,
8902
8902
  rung: "implemented"
8903
8903
  },
8904
8904
  {
8905
- ref: `${AT$1}/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"`,
8905
+ ref: `${AT$2}/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"`,
8906
8906
  rung: "implemented"
8907
8907
  },
8908
8908
  {
8909
- ref: `${AT$1}/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`,
8909
+ ref: `${AT$2}/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`,
8910
8910
  rung: "implemented"
8911
8911
  },
8912
8912
  {
8913
- ref: `${AT$1}/backend/tcop/postgres.c:3372-3430 a cancel: ERROR 55P03 "canceling statement due to lock timeout", ERROR 57014 "canceling statement due to statement timeout"`,
8913
+ ref: `${AT$2}/backend/tcop/postgres.c:3372-3430 a cancel: ERROR 55P03 "canceling statement due to lock timeout", ERROR 57014 "canceling statement due to statement timeout"`,
8914
8914
  rung: "implemented"
8915
8915
  },
8916
8916
  {
8917
- ref: `${AT$1}/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"`,
8917
+ ref: `${AT$2}/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"`,
8918
8918
  rung: "implemented"
8919
8919
  },
8920
8920
  {
8921
- ref: `${AT$1}/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`,
8921
+ ref: `${AT$2}/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`,
8922
8922
  rung: "implemented"
8923
8923
  },
8924
8924
  {
8925
- ref: `${AT$1}/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`,
8925
+ ref: `${AT$2}/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`,
8926
8926
  rung: "implemented"
8927
8927
  },
8928
8928
  {
8929
- ref: `${AT$1}/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`,
8929
+ ref: `${AT$2}/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`,
8930
8930
  rung: "implemented"
8931
8931
  },
8932
8932
  {
8933
- ref: `${AT$1}/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`,
8933
+ ref: `${AT$2}/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`,
8934
8934
  rung: "implemented"
8935
8935
  },
8936
8936
  {
8937
- ref: `${AT$1}/backend/tcop/postgres.c:4446-4502 an ERROR: disable_all_timeouts, the error to the client, AbortCurrentTransaction; :4562-4563 then ReadyForQuery`,
8937
+ ref: `${AT$2}/backend/tcop/postgres.c:4446-4502 an ERROR: disable_all_timeouts, the error to the client, AbortCurrentTransaction; :4562-4563 then ReadyForQuery`,
8938
8938
  rung: "implemented"
8939
8939
  },
8940
8940
  {
8941
- ref: `${AT$1}/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`,
8941
+ ref: `${AT$2}/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`,
8942
8942
  rung: "implemented"
8943
8943
  },
8944
8944
  {
8945
- ref: `${AT$1}/backend/storage/lmgr/proc.c:1292-1307 ProcSleep arms lock_timeout with the deadlock timer, :1652-1666 and disarms it after the wait`,
8945
+ ref: `${AT$2}/backend/storage/lmgr/proc.c:1292-1307 ProcSleep arms lock_timeout with the deadlock timer, :1652-1666 and disarms it after the wait`,
8946
8946
  rung: "implemented"
8947
8947
  },
8948
8948
  {
8949
- ref: `${AT$1}/backend/tcop/postgres.c:3652-3661 a client_connection_check_interval above 0 needs a wait set that reports a close`,
8949
+ ref: `${AT$2}/backend/tcop/postgres.c:3652-3661 a client_connection_check_interval above 0 needs a wait set that reports a close`,
8950
8950
  rung: "implemented"
8951
8951
  },
8952
8952
  {
8953
- ref: `${AT$1}/backend/libpq/pqcomm.c:2049-2084 pq_check_connection: a wait of 0 ms for WL_SOCKET_CLOSED`,
8953
+ ref: `${AT$2}/backend/libpq/pqcomm.c:2049-2084 pq_check_connection: a wait of 0 ms for WL_SOCKET_CLOSED`,
8954
8954
  rung: "implemented"
8955
8955
  },
8956
8956
  {
8957
- ref: `${AT$1}/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`,
8957
+ ref: `${AT$2}/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`,
8958
8958
  rung: "implemented"
8959
8959
  },
8960
8960
  {
8961
- ref: `${AT$1}/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`,
8961
+ ref: `${AT$2}/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`,
8962
8962
  rung: "implemented"
8963
8963
  },
8964
8964
  {
8965
- ref: `${AT$1}/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`,
8965
+ ref: `${AT$2}/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`,
8966
8966
  rung: "implemented"
8967
8967
  },
8968
8968
  {
8969
- ref: `${AT$1}/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"`,
8969
+ ref: `${AT$2}/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"`,
8970
8970
  rung: "implemented"
8971
8971
  },
8972
8972
  {
8973
- ref: `${AT$1}/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)`,
8973
+ ref: `${AT$2}/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)`,
8974
8974
  rung: "implemented"
8975
8975
  },
8976
8976
  {
8977
- ref: `${AT$1}/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`,
8977
+ ref: `${AT$2}/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`,
8978
8978
  rung: "implemented"
8979
8979
  },
8980
8980
  {
8981
- ref: `${AT$1}/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`,
8981
+ ref: `${AT$2}/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`,
8982
8982
  rung: "implemented"
8983
8983
  },
8984
8984
  {
8985
- ref: `${AT$1}/backend/tcop/postgres.c:4310-4316 the backend ignores SIGPIPE`,
8985
+ ref: `${AT$2}/backend/tcop/postgres.c:4310-4316 the backend ignores SIGPIPE`,
8986
8986
  rung: "implemented"
8987
8987
  },
8988
8988
  {
8989
- ref: `${AT$1}/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`,
8989
+ ref: `${AT$2}/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`,
8990
8990
  rung: "implemented"
8991
8991
  },
8992
8992
  {
8993
- ref: `${AT$1}/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)`,
8993
+ ref: `${AT$2}/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)`,
8994
8994
  rung: "implemented"
8995
8995
  },
8996
8996
  {
8997
- ref: `${AT$1}/backend/libpq/pqcomm.c:347-392 socket_close keeps the socket open until the process exits`,
8997
+ ref: `${AT$2}/backend/libpq/pqcomm.c:347-392 socket_close keeps the socket open until the process exits`,
8998
8998
  rung: "implemented"
8999
8999
  },
9000
9000
  {
9001
- ref: `${AT$1}/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`,
9001
+ ref: `${AT$2}/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`,
9002
9002
  rung: "implemented"
9003
9003
  },
9004
9004
  {
9005
- ref: `${AT$1}/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)`,
9005
+ ref: `${AT$2}/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)`,
9006
9006
  rung: "implemented"
9007
9007
  },
9008
9008
  {
9009
- ref: `${AT$1}/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`,
9009
+ ref: `${AT$2}/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`,
9010
9010
  rung: "implemented"
9011
9011
  },
9012
9012
  {
9013
- ref: `${AT$1}/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`,
9013
+ ref: `${AT$2}/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`,
9014
9014
  rung: "implemented"
9015
9015
  },
9016
9016
  {
@@ -11038,6 +11038,1447 @@ const PROCEDURES_WS_SERVER = machineSchema.parse({
11038
11038
  }
11039
11039
  });
11040
11040
  //#endregion
11041
+ //#region src/rabbit/amqplib.ts
11042
+ const AT$1 = "amqplib 2.2.0 lib";
11043
+ /**
11044
+ * This document is amqplib 2.2.0 on Node, for one connection to a broker of AMQP 0-9-1 and one channel
11045
+ * on it. It gives the states of the connection, from its connect to its end, and the timers that act on
11046
+ * it.
11047
+ *
11048
+ * At the defaults, amqplib takes the heartbeat that the broker proposes: 60 s for RabbitMQ 4.3. Each 30 s
11049
+ * it sends a heartbeat frame when it sent nothing since the check before. Its own heartbeat counts as a
11050
+ * send, thus an idle connection sends one each 60 s. Each 60 s it checks that the broker sent
11051
+ * something, and after two checks with nothing it ends the connection: 'Heartbeat timeout'. That end
11052
+ * comes 2 to 3 heartbeats after the last data.
11053
+ *
11054
+ * amqplib sets TCP_NODELAY only when the caller asks for it, thus Nagle is on at the defaults. It sets no
11055
+ * keepalive and no connect timeout. An RPC of a channel has no timer. The package does not connect again
11056
+ * by itself. Its recovery is a wrapper that this document does not hold.
11057
+ */
11058
+ const AMQPLIB = machineSchema.parse({
11059
+ format: "mark1russell7.machine/1",
11060
+ id: "amqplib",
11061
+ title: "amqplib 2.2.0: one connection to an AMQP 0-9-1 broker, its heartbeat and an RPC of its channel",
11062
+ layer: "driver",
11063
+ version: "2.2.0",
11064
+ conditions: {
11065
+ amqplib: "2.2.0",
11066
+ node: "24.21.0",
11067
+ client: "amqplib.connect with a URL of amqp: and the socket options of the caller, and one channel of the promise API",
11068
+ transport: "TCP to a host and port, with no TLS",
11069
+ broker: "a broker that proposes a heartbeat in connection.tune: 60 s for RabbitMQ 4.3"
11070
+ },
11071
+ sources: [
11072
+ {
11073
+ ref: `${AT$1}/connect.js:62 the heartbeat of the URL query: null when the URL has none`,
11074
+ rung: "implemented"
11075
+ },
11076
+ {
11077
+ ref: `${AT$1}/connect.js:90-94 the socket options: noDelay and keepAlive are false and timeout is undefined unless the caller gives them, and keepAliveDelay is 0`,
11078
+ rung: "implemented"
11079
+ },
11080
+ {
11081
+ ref: `${AT$1}/connect.js:150-153 at the connect, setNoDelay(noDelay), thus false at the defaults, and setKeepAlive only when keepAlive is true`,
11082
+ rung: "implemented"
11083
+ },
11084
+ {
11085
+ ref: `${AT$1}/connect.js:155-160 and :179-185 a timeout of the caller bounds the connect and the handshake ('connect ETIMEDOUT'), and the open turns it off`,
11086
+ rung: "implemented"
11087
+ },
11088
+ {
11089
+ ref: `${AT$1}/connection.js:150-176 connection.tune: with no heartbeat of the caller, the heartbeat of the broker; with 0, no heartbeat; else the smaller of the two`,
11090
+ rung: "implemented"
11091
+ },
11092
+ {
11093
+ ref: `${AT$1}/connection.js:189-198 open-ok starts the heartbeat with the tuned value, and 0 starts none (:367-368)`,
11094
+ rung: "implemented"
11095
+ },
11096
+ {
11097
+ ref: `${AT$1}/connection.js:203-216 an end or an error of the socket in the handshake fails the connect ('Socket closed abruptly during opening handshake'). After the open, an error of the socket is an error of the connection, and an end of the socket is 'Unexpected close'`,
11098
+ rung: "implemented"
11099
+ },
11100
+ {
11101
+ ref: `${AT$1}/connection.js:296-303 onSocketError emits error one time, then the connection goes to closed`,
11102
+ rung: "implemented"
11103
+ },
11104
+ {
11105
+ ref: `${AT$1}/connection.js:341-354 toClosed stops the heartbeat, ends the socket (stream.end: a FIN, not a reset) and emits close`,
11106
+ rung: "implemented"
11107
+ },
11108
+ {
11109
+ ref: `${AT$1}/connection.js:367-381 the heartbeat: on timeout, error 'Heartbeat timeout' and then closed; on beat, a heartbeat frame`,
11110
+ rung: "implemented"
11111
+ },
11112
+ {
11113
+ ref: `${AT$1}/heartbeat.js:56-77 each interval / 2 the send check sends a heartbeat when nothing went out since the check before. Each interval the receive check counts a miss when nothing came in, and two misses in a row are a timeout`,
11114
+ rung: "implemented"
11115
+ },
11116
+ {
11117
+ ref: `${AT$1}/heartbeat.js:19-25 the comment of amqplib: the timeout comes between two and three intervals after the activity stops`,
11118
+ rung: "documented"
11119
+ },
11120
+ {
11121
+ ref: `${AT$1}/connection.js:452-471 checkSend and checkRecv read and clear a flag. Each send sets the send flag, a heartbeat too: an idle connection sends one heartbeat each interval`,
11122
+ rung: "implemented"
11123
+ },
11124
+ {
11125
+ ref: `${AT$1}/connection.js:540-551 each read of bytes from the socket sets the receive flag: a heartbeat frame of the broker counts as activity (:585)`,
11126
+ rung: "implemented"
11127
+ },
11128
+ {
11129
+ ref: `${AT$1}/connection.js:587-600 a connection.close of the broker: close-ok, then closed with 'Connection closed: <code>'. Only a fatal code is an error too, and 320 CONNECTION_FORCED is not (:645-653)`,
11130
+ rung: "implemented"
11131
+ },
11132
+ {
11133
+ ref: `${AT$1}/channel.js:97-123 an RPC of a channel has no timer: it waits for its reply, or for the end of the channel`,
11134
+ rung: "implemented"
11135
+ },
11136
+ {
11137
+ ref: `${AT$1}/channel.js:155-159 the end of the channel fails the RPC in flight: 'Channel ended, no reply will be forthcoming'`,
11138
+ rung: "implemented"
11139
+ },
11140
+ {
11141
+ ref: "node v24.21.0 lib/net.js:589 (a socket has no timeout until setTimeout), :828-843 (setNoDelay)",
11142
+ rung: "implemented"
11143
+ },
11144
+ {
11145
+ ref: "node v24.21.0 lib/events.js:489-506 an error event with no listener throws",
11146
+ rung: "implemented"
11147
+ },
11148
+ {
11149
+ ref: "node v24.21.0 lib/internal/timers.js:675-692 a repeating timer counts its next interval from the time that its callback runs: the lateness of each firing carries into the next",
11150
+ rung: "implemented"
11151
+ }
11152
+ ],
11153
+ states: {
11154
+ "[none]": {
11155
+ initial: true,
11156
+ pseudo: true,
11157
+ note: "Before amqplib.connect"
11158
+ },
11159
+ connecting: { note: "The TCP connect, with no TCP_NODELAY and no keepalive at the defaults (connect.js:150-153)" },
11160
+ opening: { note: "The handshake of AMQP: the protocol header, start, tune and open, until open-ok (connection.js:85-223)" },
11161
+ idle: { note: "An open connection with no RPC in flight. The two heartbeat checks run" },
11162
+ waiting: { note: "An RPC of the channel in flight: the channel waits for its reply, with no timer. The two heartbeat checks run" },
11163
+ ended: {
11164
+ final: true,
11165
+ note: "The connection closed. amqplib does not connect again, and each RPC fails at once"
11166
+ }
11167
+ },
11168
+ events: {
11169
+ "app.connect": {
11170
+ kind: "app",
11171
+ note: "The application calls amqplib.connect"
11172
+ },
11173
+ "socket.connect": {
11174
+ kind: "local",
11175
+ note: "The TCP connect ends, and amqplib sends the protocol header"
11176
+ },
11177
+ "local.opened": {
11178
+ kind: "local",
11179
+ note: "open-ok: the end of the handshake, and the start of the heartbeat"
11180
+ },
11181
+ "app.rpc": {
11182
+ kind: "app",
11183
+ note: "An RPC of the channel goes out, for example a passive queue.declare"
11184
+ },
11185
+ "rx.reply": {
11186
+ kind: "rx",
11187
+ note: "The method that answers the RPC"
11188
+ },
11189
+ "rx.frame": {
11190
+ kind: "rx",
11191
+ note: "Bytes from the broker: a frame of a channel or a heartbeat frame. The receive check counts them as activity"
11192
+ },
11193
+ "rx.connection-close": {
11194
+ kind: "rx",
11195
+ note: "A connection.close of the broker, with its reply code and its text"
11196
+ },
11197
+ "peer.fin": {
11198
+ kind: "peer",
11199
+ note: "The broker or a middlebox ends the connection: an end of the socket"
11200
+ },
11201
+ "peer.rst": {
11202
+ kind: "peer",
11203
+ note: "A reset of the connection: the socket fails with ECONNRESET"
11204
+ },
11205
+ "socket.error": {
11206
+ kind: "local",
11207
+ note: "The socket fails with its own error: a reset, or a give-up of the kernel (ETIMEDOUT)"
11208
+ },
11209
+ "timer.connect": {
11210
+ kind: "timer",
11211
+ note: "The timeout of the socket fires before open-ok: 'connect ETIMEDOUT'"
11212
+ },
11213
+ "timer.beat": {
11214
+ kind: "timer",
11215
+ note: "The send check finds that nothing went out since the check before"
11216
+ },
11217
+ "timer.heartbeat": {
11218
+ kind: "timer",
11219
+ note: "The receive check finds nothing for the second time in a row"
11220
+ },
11221
+ "tx.heartbeat": {
11222
+ kind: "tx",
11223
+ note: "A heartbeat frame: 8 bytes (connection.js:469-471)"
11224
+ },
11225
+ "tx.fin": {
11226
+ kind: "tx",
11227
+ note: "The end of the socket of amqplib (stream.end): its FIN"
11228
+ }
11229
+ },
11230
+ knobs: {
11231
+ heartbeat: {
11232
+ key: "amqplib heartbeat, the tuned value",
11233
+ scope: "client",
11234
+ unit: "s",
11235
+ default: 60,
11236
+ off: 0,
11237
+ note: "connection.js:158-168: with no heartbeat in the URL, amqplib takes the value of the broker, 60 s for RabbitMQ 4.3 (rabbit Makefile:29). With a value of the caller, the smaller of the two. 0 is no heartbeat (2.0.0)"
11238
+ },
11239
+ timeout: {
11240
+ key: "amqplib socketOptions.timeout",
11241
+ scope: "client",
11242
+ unit: "ms",
11243
+ default: 0,
11244
+ off: 0,
11245
+ note: "connect.js:91, :179-185: undefined at the defaults, thus no timer for the connect and the handshake"
11246
+ },
11247
+ noDelay: {
11248
+ key: "amqplib socketOptions.noDelay",
11249
+ scope: "client",
11250
+ unit: null,
11251
+ default: 0,
11252
+ note: "connect.js:90, :152: false at the defaults, thus Nagle is on"
11253
+ },
11254
+ keepAlive: {
11255
+ key: "amqplib socketOptions.keepAlive",
11256
+ scope: "client",
11257
+ unit: null,
11258
+ default: 0,
11259
+ note: "connect.js:92, :153: false at the defaults, thus the socket has no keepalive"
11260
+ },
11261
+ keepAliveDelay: {
11262
+ key: "amqplib socketOptions.keepAliveDelay",
11263
+ scope: "client",
11264
+ unit: "ms",
11265
+ default: 0,
11266
+ note: "connect.js:94: the delay that setKeepAlive gets when keepAlive is true"
11267
+ },
11268
+ slack: {
11269
+ key: "the lateness of the event loop of Node for one step",
11270
+ scope: "process",
11271
+ unit: "s",
11272
+ default: .01,
11273
+ note: "An assumption of this document, not a value of amqplib: a timer or a callback of Node that comes late. In seconds, as the heartbeat"
11274
+ },
11275
+ hz: {
11276
+ key: "CONFIG_HZ",
11277
+ scope: "global",
11278
+ unit: "Hz",
11279
+ default: null,
11280
+ note: "The build option of the kernel"
11281
+ }
11282
+ },
11283
+ timers: {
11284
+ connect_timeout: {
11285
+ duration: {
11286
+ knob: "timeout",
11287
+ unit: "ms"
11288
+ },
11289
+ lateness: {
11290
+ knob: "slack",
11291
+ unit: "ms"
11292
+ },
11293
+ arms: ["enter:connecting", "enter:opening"],
11294
+ cancels: [
11295
+ "local.opened",
11296
+ "socket.error",
11297
+ "peer.rst",
11298
+ "peer.fin"
11299
+ ],
11300
+ fires: "timer.connect",
11301
+ note: "connect.js:179-185: one timeout of the socket for the connect and the handshake, which the open turns off. No bound at the defaults"
11302
+ },
11303
+ beat: {
11304
+ duration: {
11305
+ expr: "heartbeat / 2",
11306
+ unit: "s"
11307
+ },
11308
+ lateness: {
11309
+ expr: "heartbeat / 2 + 2 * slack",
11310
+ unit: "s"
11311
+ },
11312
+ arms: ["local.opened", "timer.beat"],
11313
+ fires: "timer.beat",
11314
+ note: "heartbeat.js:60: the send check each interval / 2. A send since the check before skips it, and the heartbeat counts as a send: thus an idle connection sends one each interval. The next frame of the client comes from interval / 2 to one interval after its last send"
11315
+ },
11316
+ heartbeat: {
11317
+ duration: {
11318
+ expr: "2 * heartbeat",
11319
+ unit: "s"
11320
+ },
11321
+ lateness: {
11322
+ expr: "heartbeat + 3 * slack",
11323
+ unit: "s"
11324
+ },
11325
+ arms: [
11326
+ "local.opened",
11327
+ "enter:idle",
11328
+ "enter:waiting",
11329
+ "rx.frame"
11330
+ ],
11331
+ cancels: [
11332
+ "socket.error",
11333
+ "peer.rst",
11334
+ "peer.fin",
11335
+ "rx.connection-close"
11336
+ ],
11337
+ fires: "timer.heartbeat",
11338
+ note: "heartbeat.js:64-71: the receive check each interval, and a timeout at the second miss in a row. The timer runs at a phase from the open, thus the timeout comes 2 to 3 intervals after the last bytes of the broker. The timeout is the third firing at most after those bytes, and each firing can be one slack late (node lib/internal/timers.js:675-692). It runs in each state of an open connection: the entry to a state names it here, but only bytes of the broker start it again"
11339
+ }
11340
+ },
11341
+ realizes: {
11342
+ "systems.mechanism.connect-bound": { timer: "connect_timeout" },
11343
+ "systems.mechanism.heartbeat-detection-time": { timer: "heartbeat" },
11344
+ "systems.mechanism.heartbeat-interval": { timer: "beat" },
11345
+ "systems.mechanism.idle-refresh-interval": {
11346
+ duration: {
11347
+ expr: "heartbeat / 2",
11348
+ unit: "s"
11349
+ },
11350
+ lateness: {
11351
+ expr: "heartbeat / 2 + 2 * slack",
11352
+ unit: "s"
11353
+ },
11354
+ note: "The heartbeat frames of the client on an idle connection: one each interval. The broker sends its own each interval / 2"
11355
+ }
11356
+ },
11357
+ transitions: [
11358
+ {
11359
+ id: "aq.connect",
11360
+ from: "[none]",
11361
+ to: "connecting",
11362
+ on: "app.connect",
11363
+ timer: "connect_timeout",
11364
+ source: "connect.js:166-172"
11365
+ },
11366
+ {
11367
+ id: "aq.connected",
11368
+ from: "connecting",
11369
+ to: "opening",
11370
+ on: "socket.connect",
11371
+ note: "amqplib sends the protocol header at once",
11372
+ source: "connect.js:150-172, connection.js:221-223"
11373
+ },
11374
+ {
11375
+ id: "aq.opened",
11376
+ from: "opening",
11377
+ to: "idle",
11378
+ on: "local.opened",
11379
+ note: "The heartbeat starts with the tuned value",
11380
+ source: "connection.js:189-198"
11381
+ },
11382
+ {
11383
+ id: "aq.connect-timed-out",
11384
+ from: ["connecting", "opening"],
11385
+ to: "ended",
11386
+ on: "timer.connect",
11387
+ timer: "connect_timeout",
11388
+ errno: "connect ETIMEDOUT",
11389
+ source: "connect.js:179-185"
11390
+ },
11391
+ {
11392
+ id: "aq.connect-failed",
11393
+ from: ["connecting", "opening"],
11394
+ to: "ended",
11395
+ on: [
11396
+ "socket.error",
11397
+ "peer.rst",
11398
+ "peer.fin",
11399
+ "rx.connection-close"
11400
+ ],
11401
+ note: "The connect fails with the error of the socket, 'Socket closed abruptly during opening handshake', or 'Handshake terminated by server'",
11402
+ source: "connect.js:187-189, connection.js:150-157, :203-209"
11403
+ },
11404
+ {
11405
+ id: "aq.rpc",
11406
+ from: "idle",
11407
+ to: "waiting",
11408
+ on: "app.rpc",
11409
+ note: "The RPC has no timer",
11410
+ source: "channel.js:97-123"
11411
+ },
11412
+ {
11413
+ id: "aq.replied",
11414
+ from: "waiting",
11415
+ to: "idle",
11416
+ on: "rx.reply",
11417
+ source: "channel.js:100-103"
11418
+ },
11419
+ {
11420
+ id: "aq.beat-idle",
11421
+ from: "idle",
11422
+ to: "idle",
11423
+ on: "timer.beat",
11424
+ timer: "beat",
11425
+ emits: ["tx.heartbeat"],
11426
+ source: "connection.js:378-380, :469-471"
11427
+ },
11428
+ {
11429
+ id: "aq.beat-waiting",
11430
+ from: "waiting",
11431
+ to: "waiting",
11432
+ on: "timer.beat",
11433
+ timer: "beat",
11434
+ emits: ["tx.heartbeat"],
11435
+ source: "connection.js:378-380, :469-471"
11436
+ },
11437
+ {
11438
+ id: "aq.heartbeat-timeout",
11439
+ from: ["idle", "waiting"],
11440
+ to: "ended",
11441
+ on: "timer.heartbeat",
11442
+ timer: "heartbeat",
11443
+ errno: "Heartbeat timeout",
11444
+ emits: ["tx.fin"],
11445
+ note: "The connection emits error, ends its socket with a FIN and emits close. An RPC in flight fails with 'Channel ended, no reply will be forthcoming'",
11446
+ source: "connection.js:370-376, :341-354, channel.js:155-159"
11447
+ },
11448
+ {
11449
+ id: "aq.reset",
11450
+ from: ["idle", "waiting"],
11451
+ to: "ended",
11452
+ on: ["socket.error", "peer.rst"],
11453
+ errno: "ECONNRESET",
11454
+ note: "The error of the socket, with its own code: ECONNRESET for a reset, ETIMEDOUT for a give-up of the kernel. The connection emits it, then its close",
11455
+ source: "connection.js:213-214, :296-303"
11456
+ },
11457
+ {
11458
+ id: "aq.closed",
11459
+ from: ["idle", "waiting"],
11460
+ to: "ended",
11461
+ on: "peer.fin",
11462
+ errno: "Unexpected close",
11463
+ emits: ["tx.fin"],
11464
+ note: "The end of the socket is an error of the connection, and amqplib ends its side too",
11465
+ source: "connection.js:215, :296-303, :341-354"
11466
+ },
11467
+ {
11468
+ id: "aq.closed-by-broker",
11469
+ from: ["idle", "waiting"],
11470
+ to: "ended",
11471
+ on: "rx.connection-close",
11472
+ errno: "Connection closed",
11473
+ emits: ["tx.fin"],
11474
+ note: "close-ok, then the end. The close has the reply code of the broker. For 320 (CONNECTION_FORCED) amqplib emits no error, only its close",
11475
+ source: "connection.js:587-600, :645-653"
11476
+ }
11477
+ ],
11478
+ over: {
11479
+ machine: "systems.machine.linux-tcp",
11480
+ states: {
11481
+ connecting: "SYN_SENT",
11482
+ opening: "ESTABLISHED",
11483
+ idle: "ESTABLISHED",
11484
+ waiting: "ESTABLISHED"
11485
+ },
11486
+ sets: {},
11487
+ ends: "socket.error",
11488
+ note: "The socket of the connection: a Linux TCP socket with Nagle on and no keepalive at the defaults. Thus the kernel ends a send with no ACK only at the give-up of its retransmissions"
11489
+ }
11490
+ });
11491
+ //#endregion
11492
+ //#region src/rabbit/aten.ts
11493
+ const ATEN = "aten 0.6.0";
11494
+ /**
11495
+ * This document is aten 0.6.0, the failure detector between the nodes of RabbitMQ 4.3.6. It gives one
11496
+ * node that another node watches: up or down, as the detector of the watching node sees it.
11497
+ *
11498
+ * Each node sends a heartbeat to each connected node each 100 ms. The sink of the watching node keeps
11499
+ * the gaps between the heartbeats of each node. Its detector polls each 5000 ms: aten polls each 1000 ms
11500
+ * by its own default, and RabbitMQ sets 5000 ms, for fewer false elections.
11501
+ *
11502
+ * At a poll, the probability of a failure is a share of the gaps. A gap counts when 1.5 times the gap
11503
+ * is not longer than the time since the last heartbeat. The node is down when that share reaches 0.99.
11504
+ * With gaps of approximately 100 ms, that is approximately 150 ms after the last heartbeat, at the first
11505
+ * poll after it. Thus a silent node is down 150 ms to approximately 5.2 s after its last heartbeat,
11506
+ * long before the tick of the distribution.
11507
+ *
11508
+ * A closed connection of the distribution (a stopped node) removes the data of the node from the
11509
+ * sink. The next poll then reports the node down.
11510
+ */
11511
+ const ATEN_DETECTOR = machineSchema.parse({
11512
+ format: "mark1russell7.machine/1",
11513
+ id: "aten",
11514
+ title: "aten 0.6.0: one node that the failure detector of another node of RabbitMQ watches, up or down",
11515
+ layer: "server",
11516
+ version: "0.6.0",
11517
+ conditions: {
11518
+ aten: "0.6.0",
11519
+ ra: "3.1.10",
11520
+ rabbitmq: "4.3.6",
11521
+ nodes: "two nodes of one cluster, connected by the Erlang distribution"
11522
+ },
11523
+ sources: [
11524
+ {
11525
+ ref: `${ATEN} src/aten.app.src: the defaults poll_interval 1000, scaling_factor 1.5, heartbeat_interval 100, detection_threshold 0.99`,
11526
+ rung: "implemented"
11527
+ },
11528
+ {
11529
+ ref: "rabbitmq v4.3.6 deps/rabbitmq_prelaunch/src/rabbit_prelaunch_conf.erl:112-120 RabbitMQ sets the poll interval of aten to 5000 ms, for fewer false elections of quorum queues",
11530
+ rung: "implemented"
11531
+ },
11532
+ {
11533
+ ref: "run 39218896659 of github.com/mark1russell7/systems: after a freeze and a black hole of the node of the leader, the new leader came 6.1 s to 10.4 s later, and not 1 s to 4 s",
11534
+ rung: "observed"
11535
+ },
11536
+ {
11537
+ ref: `${ATEN} src/aten_emitter.erl:49-54 and :95-98 the emitter arms its next send heartbeat_interval after it sends to each node, :63-82 it sends to each node in nodes() with noconnect and nosuspend`,
11538
+ rung: "implemented"
11539
+ },
11540
+ {
11541
+ ref: `${ATEN} src/aten_sink.erl:69-79 a heartbeat adds a sample to the state of its node, :81-87 nodedown removes the state of the node`,
11542
+ rung: "implemented"
11543
+ },
11544
+ {
11545
+ ref: `${ATEN} src/aten_detect.erl:17 a window of 1000 samples, :44-52 a sample is the gap since the heartbeat before it, :54-68 the probability is the share of the gaps S with S × factor ≤ the time since the last heartbeat`,
11546
+ rung: "implemented"
11547
+ },
11548
+ {
11549
+ ref: `${ATEN} src/aten_detector.erl:53-59 the threshold and the poll interval, :105-113 each poll arms the next poll first, then reads the probabilities, :148-186 a node goes down when its probability crosses the threshold between two polls, or when it leaves the sink`,
11550
+ rung: "implemented"
11551
+ },
11552
+ {
11553
+ ref: `${ATEN} src/aten_detector.erl:134-146 the detector sends {node_event, Node, down} or up to each process that watches the node`,
11554
+ rung: "implemented"
11555
+ },
11556
+ {
11557
+ ref: "rabbitmq v4.3.6 deps/rabbit/priv/schema/rabbit.schema:2540-2589 raft.adaptive_failure_detector.poll_interval, scaling_factor, heartbeat_interval and detection_threshold map to aten",
11558
+ rung: "implemented"
11559
+ }
11560
+ ],
11561
+ states: {
11562
+ up: {
11563
+ initial: true,
11564
+ note: "the probability of the node is below the threshold at the last poll"
11565
+ },
11566
+ down: { note: "{node_event, Node, down}: the probability crossed the threshold, or the node left the sink" }
11567
+ },
11568
+ events: {
11569
+ "rx.heartbeat": {
11570
+ kind: "rx",
11571
+ note: "a heartbeat of the node reaches the sink of the watching node"
11572
+ },
11573
+ "rx.nodedown": {
11574
+ kind: "rx",
11575
+ note: "the connection of the distribution to the node closed: the sink removes the node"
11576
+ },
11577
+ "timer.detect": {
11578
+ kind: "timer",
11579
+ note: "the first poll at which the share of the gaps reaches the threshold"
11580
+ },
11581
+ "timer.left": {
11582
+ kind: "timer",
11583
+ note: "the first poll after the node left the sink"
11584
+ }
11585
+ },
11586
+ knobs: {
11587
+ heartbeat_interval: {
11588
+ key: "raft.adaptive_failure_detector.heartbeat_interval (aten heartbeat_interval)",
11589
+ scope: "node",
11590
+ unit: "ms",
11591
+ default: 100,
11592
+ note: "aten.app.src"
11593
+ },
11594
+ poll_interval: {
11595
+ key: "raft.adaptive_failure_detector.poll_interval (aten poll_interval)",
11596
+ scope: "node",
11597
+ unit: "ms",
11598
+ default: 5e3,
11599
+ note: "RabbitMQ sets 5000 (rabbit_prelaunch_conf.erl:112-120). The default of aten itself is 1000 (aten.app.src)"
11600
+ },
11601
+ scaling_factor: {
11602
+ key: "raft.adaptive_failure_detector.scaling_factor (aten scaling_factor)",
11603
+ scope: "node",
11604
+ unit: "count",
11605
+ default: 1.5,
11606
+ note: "aten.app.src"
11607
+ },
11608
+ detection_threshold: {
11609
+ key: "raft.adaptive_failure_detector.detection_threshold (aten detection_threshold)",
11610
+ scope: "node",
11611
+ unit: "count",
11612
+ default: .99,
11613
+ note: "aten.app.src: the share of the gaps that the time since the last heartbeat must reach"
11614
+ },
11615
+ gap_slack: {
11616
+ key: "how much longer than heartbeat_interval the 99th percentile gap is",
11617
+ scope: "node",
11618
+ unit: "ms",
11619
+ default: 10,
11620
+ note: "an assumption of this document, not a value of aten: the emitter arms its next send after its sends (aten_emitter.erl:95-98), and the BEAM schedules it a little late"
11621
+ },
11622
+ slack: {
11623
+ key: "the lateness of a timer of the BEAM for one step",
11624
+ scope: "node",
11625
+ unit: "ms",
11626
+ default: 10,
11627
+ note: "an assumption of this document, not a value of aten: a send_after that fires late"
11628
+ }
11629
+ },
11630
+ timers: {
11631
+ detect: {
11632
+ duration: {
11633
+ expr: "scaling_factor * heartbeat_interval",
11634
+ unit: "ms"
11635
+ },
11636
+ lateness: {
11637
+ expr: "scaling_factor * gap_slack + poll_interval + slack",
11638
+ unit: "ms"
11639
+ },
11640
+ arms: ["rx.heartbeat"],
11641
+ fires: "timer.detect",
11642
+ note: "150 ms after the last heartbeat at the defaults, and up to one poll of 5 s later"
11643
+ },
11644
+ nodedown_poll: {
11645
+ duration: {
11646
+ const: 0,
11647
+ unit: "ms"
11648
+ },
11649
+ lateness: {
11650
+ expr: "poll_interval + slack",
11651
+ unit: "ms"
11652
+ },
11653
+ arms: ["rx.nodedown"],
11654
+ fires: "timer.left"
11655
+ }
11656
+ },
11657
+ realizes: {
11658
+ "systems.mechanism.heartbeat-detection-time": { timer: "detect" },
11659
+ "systems.mechanism.heartbeat-interval": {
11660
+ duration: {
11661
+ knob: "heartbeat_interval",
11662
+ unit: "ms"
11663
+ },
11664
+ lateness: {
11665
+ knob: "gap_slack",
11666
+ unit: "ms"
11667
+ },
11668
+ note: "each node sends a heartbeat to each connected node at this interval (aten_emitter.erl:95-98)"
11669
+ }
11670
+ },
11671
+ transitions: [
11672
+ {
11673
+ id: "aten.heartbeat",
11674
+ from: "up",
11675
+ to: "up",
11676
+ on: "rx.heartbeat",
11677
+ note: "a new sample of the gap",
11678
+ source: "aten_sink.erl:69-79"
11679
+ },
11680
+ {
11681
+ id: "aten.down",
11682
+ from: "up",
11683
+ to: "down",
11684
+ on: "timer.detect",
11685
+ timer: "detect",
11686
+ emits: ["node_event down"],
11687
+ source: "aten_detector.erl:148-186"
11688
+ },
11689
+ {
11690
+ id: "aten.left",
11691
+ from: "up",
11692
+ to: "down",
11693
+ on: "timer.left",
11694
+ timer: "nodedown_poll",
11695
+ emits: ["node_event down"],
11696
+ source: "aten_detector.erl:159-175"
11697
+ },
11698
+ {
11699
+ id: "aten.up",
11700
+ from: "down",
11701
+ to: "up",
11702
+ on: "rx.heartbeat",
11703
+ emits: ["node_event up"],
11704
+ note: "at the next poll the share is below the threshold again",
11705
+ source: "aten_detector.erl:153-155"
11706
+ }
11707
+ ]
11708
+ });
11709
+ //#endregion
11710
+ //#region src/rabbit/ra-member.ts
11711
+ const RA = "ra 3.1.10 src";
11712
+ const RMQ$1 = "rabbitmq v4.3.6 deps/rabbit/src";
11713
+ /**
11714
+ * This document is ra 3.1.10, for one member of the Raft cluster of a quorum queue of RabbitMQ 4.3.6.
11715
+ * It gives the roles of the member, the election timers, and the change of leader.
11716
+ *
11717
+ * A follower watches the node of its leader with aten. When aten reports that node down, the follower
11718
+ * arms a long election timeout. The timeout is the poll interval of aten, 5 s in RabbitMQ, and a random
11719
+ * part up to 1 s. A valid message of the leader cancels it. When the timeout fires, the follower asks for pre-votes in
11720
+ * its term.
11721
+ *
11722
+ * A member grants a pre-vote when the log of the candidate is not behind its own. A member that is
11723
+ * still a follower of a live leader grants it too. A majority of pre-votes makes a candidate. The
11724
+ * candidate starts a new term and asks for votes, and a majority makes it the leader. The new leader
11725
+ * of the queue tells each publisher of the queue. Then the channel of each publisher sends its pending
11726
+ * publishes again to the new leader.
11727
+ *
11728
+ * A leader ignores the events of aten. Thus a leader that loses the majority stays the leader in its
11729
+ * minority, and it commits nothing, until it sees a higher term.
11730
+ */
11731
+ const RA_MEMBER = machineSchema.parse({
11732
+ format: "mark1russell7.machine/1",
11733
+ id: "ra-member",
11734
+ title: "ra 3.1.10: one member of the Raft cluster of a quorum queue of RabbitMQ 4.3.6, its elections and its leader",
11735
+ layer: "server",
11736
+ version: "3.1.10",
11737
+ conditions: {
11738
+ ra: "3.1.10",
11739
+ aten: "0.6.0",
11740
+ rabbitmq: "4.3.6",
11741
+ queue: "a quorum queue of three members, one on each node of the cluster, each one a voter"
11742
+ },
11743
+ sources: [
11744
+ {
11745
+ ref: "rabbitmq v4.3.6 rabbitmq-components.mk:58 dep_ra = hex 3.1.10",
11746
+ rung: "implemented"
11747
+ },
11748
+ {
11749
+ ref: `${RA}/ra_server_proc.erl:66-68 DEFAULT_BROADCAST_TIME 100, DEFAULT_ELECTION_MULT 5, TICK_INTERVAL_MS 1000`,
11750
+ rung: "implemented"
11751
+ },
11752
+ {
11753
+ ref: `${RA}/ra_server_proc.erl:384 the member reads the poll interval of aten: 1000 ms by default, and 5000 ms in RabbitMQ (rabbit_prelaunch_conf.erl:112-120)`,
11754
+ rung: "implemented"
11755
+ },
11756
+ {
11757
+ ref: `${RA}/ra_server_proc.erl:1931-1950 the election timeouts: really_short rand(broadcast), short rand(5 × broadcast) + broadcast, medium rand(poll) + broadcast, long rand(10 × broadcast) + poll`,
11758
+ rung: "implemented"
11759
+ },
11760
+ {
11761
+ ref: `${RA}/ra_server_proc.erl:2350-2357 an election timeout that is set is not set again, and :2359-2367 each change of role cancels it`,
11762
+ rung: "implemented"
11763
+ },
11764
+ {
11765
+ ref: `${RA}/ra_server_proc.erl:802-825 a follower that is not new arms a long timeout when it enters the role`,
11766
+ rung: "implemented"
11767
+ },
11768
+ {
11769
+ ref: `${RA}/ra_server_proc.erl:1844-1851 a valid message of the leader cancels the election timeout of a follower`,
11770
+ rung: "implemented"
11771
+ },
11772
+ {
11773
+ ref: `${RA}/ra_server_proc.erl:899-919 aten reports the node of the leader down: a long timeout; up again: the timeout stops`,
11774
+ rung: "implemented"
11775
+ },
11776
+ {
11777
+ ref: `${RA}/ra_server_proc.erl:869-896 the monitor of the leader goes down: short for noconnection, really_short for each other reason`,
11778
+ rung: "implemented"
11779
+ },
11780
+ {
11781
+ ref: `${RA}/ra_server_proc.erl:1958-1981 a follower watches the node of a new leader with aten, and logs the new leader`,
11782
+ rung: "implemented"
11783
+ },
11784
+ {
11785
+ ref: `${RA}/ra_server.erl:1625-1626 the election timeout of a follower asks for pre-votes, and :2900-2923 a pre-vote round is in the current term`,
11786
+ rung: "implemented"
11787
+ },
11788
+ {
11789
+ ref: `${RA}/ra_server_proc.erl:739-743 a member in pre-vote arms a long timeout, and ra_server.erl:1255-1256 its timeout asks again`,
11790
+ rung: "implemented"
11791
+ },
11792
+ {
11793
+ ref: `${RA}/ra_server.erl:2925-2985 a member grants a pre-vote when the term is not lower and the log of the candidate is not behind; a follower that declines arms its own long timeout`,
11794
+ rung: "implemented"
11795
+ },
11796
+ {
11797
+ ref: `${RA}/ra_server.erl:1229-1245 a majority of pre-votes makes a candidate, and :2880-2899 the candidate starts a new term and asks for votes`,
11798
+ rung: "implemented"
11799
+ },
11800
+ {
11801
+ ref: `${RA}/ra_server_proc.erl:674-677 a candidate arms a short timeout, and ra_server.erl:1161-1162 its timeout starts a new election`,
11802
+ rung: "implemented"
11803
+ },
11804
+ {
11805
+ ref: `${RA}/ra_server.erl:1045-1061 a majority of votes makes the leader`,
11806
+ rung: "implemented"
11807
+ },
11808
+ {
11809
+ ref: `${RA}/ra_server_proc.erl:1742-1755 each vote request is a call with the poll interval of aten as its timeout`,
11810
+ rung: "implemented"
11811
+ },
11812
+ {
11813
+ ref: `${RA}/ra_server_proc.erl:597-598 a leader ignores the events of aten`,
11814
+ rung: "implemented"
11815
+ },
11816
+ {
11817
+ ref: `${RA}/ra_server.erl:928-942 and :946-960 a leader that sees a vote request or a pre-vote request of a higher term becomes a follower`,
11818
+ rung: "implemented"
11819
+ },
11820
+ {
11821
+ ref: `${RA}/ra_server.erl:1008-1032 a transfer of leadership: the leader waits, and it sends an election timeout to the member that gets the leadership`,
11822
+ rung: "implemented"
11823
+ },
11824
+ {
11825
+ ref: `${RA}/ra_server_proc.erl:683-687 and :749-753 a candidate and a member in pre-vote reject a command`,
11826
+ rung: "implemented"
11827
+ },
11828
+ {
11829
+ ref: `${RA}/ra_server_proc.erl:1336-1345 each change from or to leader is a NOTICE in the log, and each other change is DEBUG`,
11830
+ rung: "implemented"
11831
+ },
11832
+ {
11833
+ ref: `${RMQ$1}/rabbit_fifo.erl:1111-1123 a new leader of the queue sends leader_change to each publisher`,
11834
+ rung: "implemented"
11835
+ },
11836
+ {
11837
+ ref: `${RMQ$1}/rabbit_fifo_client.erl:738-760 the channel sends each pending publish again to the new leader, on leader_change or on a rejection`,
11838
+ rung: "implemented"
11839
+ },
11840
+ {
11841
+ ref: `${RMQ$1}/rabbit_quorum_queue.erl:175 and :2427-2441 the tick of a member is quorum_tick_interval, 5000 ms; RabbitMQ sets no broadcast time`,
11842
+ rung: "implemented"
11843
+ }
11844
+ ],
11845
+ states: {
11846
+ follower: {
11847
+ initial: true,
11848
+ note: "it follows the leader, and its election timeout runs when no valid message of the leader cancels it"
11849
+ },
11850
+ pre_vote: { note: "it asks for pre-votes in its term, and it rejects each command" },
11851
+ candidate: { note: "a new term, its vote for itself, and a vote request to each member. A round with no majority before the timeout starts a new election after a medium timeout (101 ms to 1.1 s)" },
11852
+ leader: { note: "it commits with a majority. It ignores aten: without a majority it stays the leader and commits nothing" }
11853
+ },
11854
+ events: {
11855
+ "local.leader-node-down": {
11856
+ kind: "local",
11857
+ note: "{node_event, Node, down}: aten reports the node of the leader down"
11858
+ },
11859
+ "local.leader-node-up": {
11860
+ kind: "local",
11861
+ note: "{node_event, Node, up}: aten reports the node of the leader up again"
11862
+ },
11863
+ "rx.leader-noconnection": {
11864
+ kind: "rx",
11865
+ note: "the monitor of the leader goes down with noconnection: the distribution to its node closed"
11866
+ },
11867
+ "rx.leader-exit": {
11868
+ kind: "rx",
11869
+ note: "the monitor of the leader goes down with another reason: the process of the leader is gone"
11870
+ },
11871
+ "rx.leader-message": {
11872
+ kind: "rx",
11873
+ note: "a valid append_entries or heartbeat of the leader (record_leader_msg)"
11874
+ },
11875
+ "timer.election": {
11876
+ kind: "timer",
11877
+ note: "the state timeout election_timeout"
11878
+ },
11879
+ "rx.pre-votes": {
11880
+ kind: "rx",
11881
+ note: "a majority of granted pre-votes, its own one too"
11882
+ },
11883
+ "rx.pre-vote-declined": {
11884
+ kind: "rx",
11885
+ note: "a pre-vote request whose candidate has a log behind this member: it declines and arms its own timeout"
11886
+ },
11887
+ "rx.votes": {
11888
+ kind: "rx",
11889
+ note: "a majority of votes, its own one too"
11890
+ },
11891
+ "rx.higher-term": {
11892
+ kind: "rx",
11893
+ note: "a message of a term that is not lower: a leader of that term, or a vote request of a higher term"
11894
+ },
11895
+ "app.transfer": {
11896
+ kind: "app",
11897
+ note: "the leader sends election_timeout to the member that gets the leadership (rabbitmq-queues transfer_leadership)"
11898
+ }
11899
+ },
11900
+ knobs: {
11901
+ broadcast_time: {
11902
+ key: "broadcast_time of the ra server",
11903
+ scope: "queue",
11904
+ unit: "ms",
11905
+ default: 100,
11906
+ note: "ra_server_proc.erl:66: RabbitMQ sets none"
11907
+ },
11908
+ election_mult: {
11909
+ key: "DEFAULT_ELECTION_MULT",
11910
+ scope: "build",
11911
+ unit: "count",
11912
+ default: 5,
11913
+ note: "ra_server_proc.erl:67"
11914
+ },
11915
+ aten_poll_interval: {
11916
+ key: "raft.adaptive_failure_detector.poll_interval (aten poll_interval)",
11917
+ scope: "node",
11918
+ unit: "ms",
11919
+ default: 5e3,
11920
+ note: "ra_server_proc.erl:384 reads it. RabbitMQ sets 5000 (rabbit_prelaunch_conf.erl:112-120)"
11921
+ },
11922
+ tick_timeout: {
11923
+ key: "quorum_tick_interval",
11924
+ scope: "node",
11925
+ unit: "ms",
11926
+ default: 5e3,
11927
+ note: "rabbit_quorum_queue.erl:175, :2435-2441"
11928
+ },
11929
+ slack: {
11930
+ key: "the lateness of a timer of the BEAM for one step",
11931
+ scope: "node",
11932
+ unit: "ms",
11933
+ default: 10,
11934
+ note: "an assumption of this document, not a value of ra: a state timeout that fires late"
11935
+ },
11936
+ commit_work: {
11937
+ key: "the local work of one command: the writes and the fsyncs of the logs of a leader and a follower, and the apply",
11938
+ scope: "node",
11939
+ unit: "ms",
11940
+ default: 50,
11941
+ note: "an assumption of this document, not a value of ra: the WAL writes each batch and syncs it with fdatasync before the commit (ra_log_wal.erl:89, :772-798)"
11942
+ },
11943
+ rtt: {
11944
+ key: "the round trip between members",
11945
+ scope: "path",
11946
+ unit: "ms",
11947
+ default: null
11948
+ }
11949
+ },
11950
+ timers: {
11951
+ election_long: {
11952
+ duration: {
11953
+ expr: "aten_poll_interval + 1",
11954
+ unit: "ms"
11955
+ },
11956
+ lateness: {
11957
+ expr: "broadcast_time * election_mult * 2 - 1 + slack",
11958
+ unit: "ms"
11959
+ },
11960
+ arms: [
11961
+ "enter:follower",
11962
+ "enter:pre_vote",
11963
+ "local.leader-node-down",
11964
+ "rx.pre-vote-declined"
11965
+ ],
11966
+ cancels: ["rx.leader-message", "local.leader-node-up"],
11967
+ fires: "timer.election",
11968
+ note: "longer than one poll of aten, thus a false report of aten can end before an election (ra_server_proc.erl:1944-1949)"
11969
+ },
11970
+ election_short: {
11971
+ duration: {
11972
+ expr: "broadcast_time + 1",
11973
+ unit: "ms"
11974
+ },
11975
+ lateness: {
11976
+ expr: "broadcast_time * election_mult - 1 + slack",
11977
+ unit: "ms"
11978
+ },
11979
+ arms: ["enter:candidate", "rx.leader-noconnection"],
11980
+ cancels: ["rx.leader-message"],
11981
+ fires: "timer.election"
11982
+ },
11983
+ election_really_short: {
11984
+ duration: {
11985
+ const: 1,
11986
+ unit: "ms"
11987
+ },
11988
+ lateness: {
11989
+ expr: "broadcast_time - 1 + slack",
11990
+ unit: "ms"
11991
+ },
11992
+ arms: ["rx.leader-exit"],
11993
+ cancels: ["rx.leader-message"],
11994
+ fires: "timer.election"
11995
+ }
11996
+ },
11997
+ realizes: { "systems.mechanism.election-timeout": { timer: "election_long" } },
11998
+ transitions: [
11999
+ {
12000
+ id: "ra.leader-message",
12001
+ from: "follower",
12002
+ to: "follower",
12003
+ on: "rx.leader-message",
12004
+ note: "the election timeout stops",
12005
+ source: "ra_server_proc.erl:1844-1851"
12006
+ },
12007
+ {
12008
+ id: "ra.leader-node-down",
12009
+ from: "follower",
12010
+ to: "follower",
12011
+ on: "local.leader-node-down",
12012
+ note: "the long election timeout starts",
12013
+ source: "ra_server_proc.erl:899-908"
12014
+ },
12015
+ {
12016
+ id: "ra.pre-vote",
12017
+ from: "follower",
12018
+ to: "pre_vote",
12019
+ on: ["timer.election", "app.transfer"],
12020
+ source: "ra_server.erl:1625-1626, :2900-2923"
12021
+ },
12022
+ {
12023
+ id: "ra.pre-vote-again",
12024
+ from: "pre_vote",
12025
+ to: "pre_vote",
12026
+ on: "timer.election",
12027
+ timer: "election_long",
12028
+ source: "ra_server.erl:1255-1256"
12029
+ },
12030
+ {
12031
+ id: "ra.candidate",
12032
+ from: "pre_vote",
12033
+ to: "candidate",
12034
+ on: "rx.pre-votes",
12035
+ source: "ra_server.erl:1229-1245, :2880-2899"
12036
+ },
12037
+ {
12038
+ id: "ra.election-again",
12039
+ from: "candidate",
12040
+ to: "candidate",
12041
+ on: "timer.election",
12042
+ timer: "election_short",
12043
+ source: "ra_server.erl:1161-1162"
12044
+ },
12045
+ {
12046
+ id: "ra.leader",
12047
+ from: "candidate",
12048
+ to: "leader",
12049
+ on: "rx.votes",
12050
+ emits: ["candidate -> leader", "leader_change"],
12051
+ note: "the NOTICE of the change, and leader_change to each publisher of the queue",
12052
+ source: "ra_server.erl:1045-1061, ra_server_proc.erl:1336-1345, rabbit_fifo.erl:1111-1123"
12053
+ },
12054
+ {
12055
+ id: "ra.follow",
12056
+ from: ["pre_vote", "candidate"],
12057
+ to: "follower",
12058
+ on: "rx.higher-term",
12059
+ source: "ra_server.erl:1062-1084"
12060
+ },
12061
+ {
12062
+ id: "ra.abdicate",
12063
+ from: "leader",
12064
+ to: "follower",
12065
+ on: "rx.higher-term",
12066
+ emits: ["leader -> follower"],
12067
+ source: "ra_server.erl:928-942, :946-960"
12068
+ }
12069
+ ],
12070
+ observe: { "rabbitmq-log": {
12071
+ fidelity: "lossy",
12072
+ states: {
12073
+ leader: "leader",
12074
+ follower: "follower"
12075
+ },
12076
+ hides: ["pre_vote", "candidate"],
12077
+ note: "at the default level the log has each change from or to leader (NOTICE), and the new leader that a follower detects (INFO). The elections are DEBUG"
12078
+ } }
12079
+ });
12080
+ //#endregion
12081
+ //#region src/rabbit/rabbitmq-connection.ts
12082
+ const RMQ = "v4.3.6";
12083
+ /**
12084
+ * This document is RabbitMQ 4.3.6, for one connection of AMQP 0-9-1 on the broker. It gives the reader of
12085
+ * the connection, from the accept to the close, and the timers that act on it.
12086
+ *
12087
+ * At the defaults the broker proposes a heartbeat of 60 s, and it uses the value of the tune-ok of the
12088
+ * client. Each 30 s it sends a heartbeat frame when it sent nothing: its own heartbeat does not count,
12089
+ * thus an idle connection gets one each 30 s. Each 60 s it checks that the client sent something. After
12090
+ * two checks with nothing, it ends the connection, 2 to 3 heartbeats after the last data.
12091
+ *
12092
+ * Each socket of a listener has linger 0, thus each close of the broker is a reset, not a FIN. The
12093
+ * listener of ranch gives each socket a send timeout of 30 s. After it, the BEAM closes the socket, with
12094
+ * a reset too. A resource alarm blocks a connection that publishes: the reader stops to read
12095
+ * its socket, and the receive check pauses.
12096
+ */
12097
+ const RABBITMQ_CONNECTION = machineSchema.parse({
12098
+ format: "mark1russell7.machine/1",
12099
+ id: "rabbitmq-connection",
12100
+ title: "RabbitMQ 4.3.6: one connection of AMQP 0-9-1 on the broker, its heartbeat, its send timeout and its close",
12101
+ layer: "server",
12102
+ version: "4.3.6",
12103
+ conditions: {
12104
+ rabbitmq: "4.3.6",
12105
+ ranch: "2.3.0",
12106
+ listener: "the AMQP listener of the broker with the default tcp_listen_options, and no TLS",
12107
+ connection: "a connection of AMQP 0-9-1 that a client opens, with the heartbeat of its tune-ok"
12108
+ },
12109
+ sources: [
12110
+ {
12111
+ ref: `${RMQ} deps/rabbit/Makefile:29 the default heartbeat of the broker: 60 s`,
12112
+ rung: "implemented"
12113
+ },
12114
+ {
12115
+ ref: `${RMQ} deps/rabbit/Makefile:57 handshake_timeout 10000 ms`,
12116
+ rung: "implemented"
12117
+ },
12118
+ {
12119
+ ref: `${RMQ} deps/rabbit/Makefile:60-64 tcp_listen_options: backlog 128, nodelay true, linger {true, 0}, exit_on_close false`,
12120
+ rung: "implemented"
12121
+ },
12122
+ {
12123
+ ref: `${RMQ} deps/rabbit/src/tcp_listener_sup.erl:40-53 the listener is a ranch listener, with tcp_listen_options as its socket options`,
12124
+ rung: "implemented"
12125
+ },
12126
+ {
12127
+ ref: `${RMQ} rabbitmq-components.mk:59 ranch 2.3.0. ranch 2.3.0 src/ranch_tcp.erl:106-109: a listener sets send_timeout 30000 and send_timeout_close true unless its options give them, and tcp_listen_options gives neither`,
12128
+ rung: "implemented"
12129
+ },
12130
+ {
12131
+ ref: `${RMQ} deps/rabbit/src/rabbit_reader.erl:1292-1323 tune-ok: the heartbeat of the client is the timeout of the two heartbeaters`,
12132
+ rung: "implemented"
12133
+ },
12134
+ {
12135
+ ref: `${RMQ} deps/rabbit_common/src/rabbit_heartbeat.erl:73-78 the sender: each timeout / 2, a heartbeat frame when send_oct did not change`,
12136
+ rung: "implemented"
12137
+ },
12138
+ {
12139
+ ref: `${RMQ} deps/rabbit_common/src/rabbit_heartbeat.erl:150-158 after the handler of the sender, it reads send_oct again: its own heartbeat does not count as a send, thus an idle connection gets one each timeout / 2`,
12140
+ rung: "implemented"
12141
+ },
12142
+ {
12143
+ ref: `${RMQ} deps/rabbit_common/src/rabbit_heartbeat.erl:80-85 the receiver: each timeout, a miss when recv_oct did not change, and the end at the second miss in a row. The comment: the end comes between 2 and 3 intervals after the last data`,
12144
+ rung: "implemented"
12145
+ },
12146
+ {
12147
+ ref: `${RMQ} deps/rabbit/src/rabbit_reader.erl:650-655 heartbeat_timeout ends the reader, and :405-407 logs 'missed heartbeats from client, timeout: <T>s'`,
12148
+ rung: "implemented"
12149
+ },
12150
+ {
12151
+ ref: `${RMQ} deps/rabbit/src/rabbit_reader.erl:302-304, :644-649 a timer of handshake_timeout from the start of the reader. It ends a connection that is not open at that time`,
12152
+ rung: "implemented"
12153
+ },
12154
+ {
12155
+ ref: `${RMQ} deps/rabbit/src/rabbit_reader.erl:368-372 at the end of the reader, rabbit_net:fast_close and not gen_tcp:close, which waits for the output. deps/rabbit_common/src/rabbit_net.erl:182-184 fast_close is port_close`,
12156
+ rung: "implemented"
12157
+ },
12158
+ {
12159
+ ref: `${RMQ} deps/rabbit/src/rabbit_reader.erl:541-542 an end of the socket stops the reader: 'client unexpectedly closed TCP connection' (:410-446)`,
12160
+ rung: "implemented"
12161
+ },
12162
+ {
12163
+ ref: `${RMQ} deps/rabbit/src/rabbit_reader.erl:480-481, :1803-1830 a resource alarm blocks a connection that publishes: the reader does not read its socket, and the receive check pauses until the unblock`,
12164
+ rung: "implemented"
12165
+ },
12166
+ {
12167
+ ref: "Linux: a close of a socket with SO_LINGER on and a linger time of 0 sends a reset and drops the send queue (tcp_close, net/ipv4/tcp.c). An assumption of this document about the kernel",
12168
+ rung: "documented"
12169
+ }
12170
+ ],
12171
+ states: {
12172
+ "[none]": {
12173
+ initial: true,
12174
+ pseudo: true,
12175
+ note: "Before ranch accepts the connection"
12176
+ },
12177
+ handshake: { note: "The protocol header, start-ok, tune-ok and open, until open-ok. The handshake timer runs" },
12178
+ running: { note: "An open connection: the reader reads each frame, and the two heartbeaters run" },
12179
+ blocked: { note: "A resource alarm blocked the connection: the reader does not read its socket, and the receive check pauses" },
12180
+ ended: {
12181
+ final: true,
12182
+ note: "The reader ended, and the broker closed the socket with linger 0: a reset"
12183
+ }
12184
+ },
12185
+ events: {
12186
+ "local.accept": {
12187
+ kind: "local",
12188
+ note: "ranch accepts the TCP connection"
12189
+ },
12190
+ "rx.opened": {
12191
+ kind: "rx",
12192
+ note: "connection.open of the client, then open-ok: the end of the handshake"
12193
+ },
12194
+ "rx.frame": {
12195
+ kind: "rx",
12196
+ note: "Bytes from the client: a frame of a channel or a heartbeat frame. recv_oct counts them"
12197
+ },
12198
+ "local.alarm": {
12199
+ kind: "local",
12200
+ note: "A resource alarm of memory or of disk, on a connection that publishes"
12201
+ },
12202
+ "local.alarm-cleared": {
12203
+ kind: "local",
12204
+ note: "The alarm clears"
12205
+ },
12206
+ "local.send-blocked": {
12207
+ kind: "local",
12208
+ note: "A write of the broker waits: the send buffer of the socket is full"
12209
+ },
12210
+ "local.send-drained": {
12211
+ kind: "local",
12212
+ note: "The write ends"
12213
+ },
12214
+ "peer.fin": {
12215
+ kind: "peer",
12216
+ note: "The client ends the connection: an end of the socket"
12217
+ },
12218
+ "peer.rst": {
12219
+ kind: "peer",
12220
+ note: "A reset of the connection"
12221
+ },
12222
+ "socket.error": {
12223
+ kind: "local",
12224
+ note: "The socket fails: a reset, or a give-up of the kernel"
12225
+ },
12226
+ "timer.handshake": {
12227
+ kind: "timer",
12228
+ note: "handshake_timeout before open-ok"
12229
+ },
12230
+ "timer.beat": {
12231
+ kind: "timer",
12232
+ note: "The sender finds that send_oct did not change for timeout / 2"
12233
+ },
12234
+ "timer.heartbeat": {
12235
+ kind: "timer",
12236
+ note: "The receiver finds that recv_oct did not change, for the second time in a row"
12237
+ },
12238
+ "timer.send": {
12239
+ kind: "timer",
12240
+ note: "A write waits send_timeout: the BEAM closes the socket"
12241
+ },
12242
+ "tx.heartbeat": {
12243
+ kind: "tx",
12244
+ note: "A heartbeat frame"
12245
+ },
12246
+ "tx.rst": {
12247
+ kind: "tx",
12248
+ note: "The close of the broker with linger 0: a reset to the client"
12249
+ }
12250
+ },
12251
+ knobs: {
12252
+ heartbeat: {
12253
+ key: "rabbitmq heartbeat, the tuned value",
12254
+ scope: "server",
12255
+ unit: "s",
12256
+ default: 60,
12257
+ off: 0,
12258
+ note: "Makefile:29 proposes 60 s, and the reader uses the value of the tune-ok of the client (rabbit_reader.erl:1292-1323). 0 is no heartbeat"
12259
+ },
12260
+ handshake_timeout: {
12261
+ key: "rabbitmq handshake_timeout",
12262
+ scope: "server",
12263
+ unit: "ms",
12264
+ default: 1e4,
12265
+ note: "Makefile:57"
12266
+ },
12267
+ send_timeout: {
12268
+ key: "the send_timeout of a socket of the listener",
12269
+ scope: "server",
12270
+ unit: "ms",
12271
+ default: 3e4,
12272
+ note: "ranch 2.3.0 src/ranch_tcp.erl:108-109: 30000, with send_timeout_close true. tcp_listen_options of RabbitMQ does not set it"
12273
+ },
12274
+ slack: {
12275
+ key: "the lateness of the scheduler of the BEAM for one step",
12276
+ scope: "process",
12277
+ unit: "s",
12278
+ default: .01,
12279
+ note: "An assumption of this document, not a value of RabbitMQ: a timer of the BEAM that comes late. In seconds, as the heartbeat"
12280
+ }
12281
+ },
12282
+ timers: {
12283
+ handshake: {
12284
+ duration: {
12285
+ knob: "handshake_timeout",
12286
+ unit: "ms"
12287
+ },
12288
+ lateness: {
12289
+ knob: "slack",
12290
+ unit: "ms"
12291
+ },
12292
+ arms: ["local.accept"],
12293
+ cancels: [
12294
+ "rx.opened",
12295
+ "peer.fin",
12296
+ "peer.rst",
12297
+ "socket.error"
12298
+ ],
12299
+ fires: "timer.handshake",
12300
+ note: "rabbit_reader.erl:302-304, :644-649: from the start of the reader. A running connection ignores it"
12301
+ },
12302
+ beat: {
12303
+ duration: {
12304
+ expr: "heartbeat / 2",
12305
+ unit: "s"
12306
+ },
12307
+ lateness: {
12308
+ expr: "heartbeat / 2 + 2 * slack",
12309
+ unit: "s"
12310
+ },
12311
+ arms: ["rx.opened", "timer.beat"],
12312
+ fires: "timer.beat",
12313
+ note: "rabbit_heartbeat.erl:73-78, :150-158: the check each timeout / 2. Its own heartbeat does not count, thus an idle connection gets a frame each timeout / 2. After a frame of a channel, the next frame comes from timeout / 2 to one timeout later"
12314
+ },
12315
+ heartbeat: {
12316
+ duration: {
12317
+ expr: "2 * heartbeat",
12318
+ unit: "s"
12319
+ },
12320
+ lateness: {
12321
+ expr: "heartbeat + 3 * slack",
12322
+ unit: "s"
12323
+ },
12324
+ arms: [
12325
+ "rx.opened",
12326
+ "enter:running",
12327
+ "rx.frame",
12328
+ "local.alarm-cleared"
12329
+ ],
12330
+ cancels: [
12331
+ "local.alarm",
12332
+ "peer.fin",
12333
+ "peer.rst",
12334
+ "socket.error"
12335
+ ],
12336
+ fires: "timer.heartbeat",
12337
+ note: "rabbit_heartbeat.erl:80-85: the check each timeout, and the end at the second miss in a row: 2 to 3 timeouts after the last data. Each check arms the next one after it reads the stats (rabbit_heartbeat.erl:121-158), thus each one can be one slack late. A block pauses it, and the unblock starts it again (rabbit_reader.erl:1803-1830). The entry to running names it here, but only bytes of the client start it again"
12338
+ },
12339
+ send: {
12340
+ duration: {
12341
+ knob: "send_timeout",
12342
+ unit: "ms"
12343
+ },
12344
+ lateness: {
12345
+ knob: "slack",
12346
+ unit: "ms"
12347
+ },
12348
+ arms: ["local.send-blocked"],
12349
+ cancels: ["local.send-drained"],
12350
+ fires: "timer.send",
12351
+ note: "ranch 2.3.0: send_timeout_close. A write that waits 30 s fails, and the BEAM closes the socket: with linger 0, a reset"
12352
+ }
12353
+ },
12354
+ realizes: {
12355
+ "systems.mechanism.heartbeat-detection-time": { timer: "heartbeat" },
12356
+ "systems.mechanism.heartbeat-interval": { timer: "beat" },
12357
+ "systems.mechanism.idle-refresh-interval": {
12358
+ duration: {
12359
+ expr: "heartbeat / 2",
12360
+ unit: "s"
12361
+ },
12362
+ lateness: {
12363
+ knob: "slack",
12364
+ unit: "s"
12365
+ },
12366
+ note: "The heartbeat frames of the broker on an idle connection: one each timeout / 2"
12367
+ }
12368
+ },
12369
+ transitions: [
12370
+ {
12371
+ id: "rq.accept",
12372
+ from: "[none]",
12373
+ to: "handshake",
12374
+ on: "local.accept",
12375
+ timer: "handshake",
12376
+ source: "rabbit_reader.erl:290-304"
12377
+ },
12378
+ {
12379
+ id: "rq.opened",
12380
+ from: "handshake",
12381
+ to: "running",
12382
+ on: "rx.opened",
12383
+ note: "The two heartbeaters start with the value of the tune-ok",
12384
+ source: "rabbit_reader.erl:1292-1328"
12385
+ },
12386
+ {
12387
+ id: "rq.handshake-timed-out",
12388
+ from: "handshake",
12389
+ to: "ended",
12390
+ on: "timer.handshake",
12391
+ timer: "handshake",
12392
+ errno: "handshake_timeout",
12393
+ emits: ["tx.rst"],
12394
+ source: "rabbit_reader.erl:644-649, :368-372"
12395
+ },
12396
+ {
12397
+ id: "rq.beat-running",
12398
+ from: "running",
12399
+ to: "running",
12400
+ on: "timer.beat",
12401
+ timer: "beat",
12402
+ emits: ["tx.heartbeat"],
12403
+ source: "rabbit_reader.erl:1305-1318"
12404
+ },
12405
+ {
12406
+ id: "rq.beat-blocked",
12407
+ from: "blocked",
12408
+ to: "blocked",
12409
+ on: "timer.beat",
12410
+ timer: "beat",
12411
+ emits: ["tx.heartbeat"],
12412
+ source: "rabbit_reader.erl:1305-1318"
12413
+ },
12414
+ {
12415
+ id: "rq.heartbeat-timeout",
12416
+ from: "running",
12417
+ to: "ended",
12418
+ on: "timer.heartbeat",
12419
+ timer: "heartbeat",
12420
+ errno: "missed heartbeats from client",
12421
+ emits: ["tx.rst"],
12422
+ source: "rabbit_reader.erl:650-655, :405-407, :368-372"
12423
+ },
12424
+ {
12425
+ id: "rq.block",
12426
+ from: "running",
12427
+ to: "blocked",
12428
+ on: "local.alarm",
12429
+ note: "The reader sends connection.blocked when the client can take it",
12430
+ source: "rabbit_reader.erl:1803-1815"
12431
+ },
12432
+ {
12433
+ id: "rq.unblock",
12434
+ from: "blocked",
12435
+ to: "running",
12436
+ on: "local.alarm-cleared",
12437
+ source: "rabbit_reader.erl:1817-1825"
12438
+ },
12439
+ {
12440
+ id: "rq.client-closed",
12441
+ from: ["running", "blocked"],
12442
+ to: "ended",
12443
+ on: "peer.fin",
12444
+ errno: "client unexpectedly closed TCP connection",
12445
+ emits: ["tx.rst"],
12446
+ note: "The end of the reader closes the socket with linger 0: a reset to the client, which closed already",
12447
+ source: "rabbit_reader.erl:541-542, :410-446, :368-372"
12448
+ },
12449
+ {
12450
+ id: "rq.reset",
12451
+ from: ["running", "blocked"],
12452
+ to: "ended",
12453
+ on: ["peer.rst", "socket.error"],
12454
+ errno: "ECONNRESET",
12455
+ source: "rabbit_reader.erl:547-548"
12456
+ },
12457
+ {
12458
+ id: "rq.send-timed-out",
12459
+ from: ["running", "blocked"],
12460
+ to: "ended",
12461
+ on: "timer.send",
12462
+ timer: "send",
12463
+ errno: "timeout",
12464
+ emits: ["tx.rst"],
12465
+ note: "The BEAM closes the socket at the send timeout, with linger 0: a reset, short enough to pass an MTU black hole",
12466
+ source: "ranch 2.3.0 src/ranch_tcp.erl:108-109"
12467
+ }
12468
+ ],
12469
+ over: {
12470
+ machine: "systems.machine.linux-tcp",
12471
+ states: {
12472
+ handshake: "ESTABLISHED",
12473
+ running: "ESTABLISHED",
12474
+ blocked: "ESTABLISHED"
12475
+ },
12476
+ sets: {},
12477
+ ends: "socket.error",
12478
+ note: "The socket of the connection on the broker: TCP_NODELAY on, no keepalive, and SO_LINGER on with 0, thus each close of the broker is a reset"
12479
+ }
12480
+ });
12481
+ //#endregion
11041
12482
  //#region src/sentinel.ts
11042
12483
  const AT = "valkey 9.1.2 src/sentinel.c";
11043
12484
  /**
@@ -11658,9 +13099,13 @@ const MACHINES = byId([
11658
13099
  PGBOUNCER_SERVER,
11659
13100
  PGPOOL_SESSION,
11660
13101
  SUPAVISOR_CLIENT,
11661
- SUPAVISOR_SERVER
13102
+ SUPAVISOR_SERVER,
13103
+ AMQPLIB,
13104
+ RABBITMQ_CONNECTION,
13105
+ ATEN_DETECTOR,
13106
+ RA_MEMBER
11662
13107
  ]);
11663
13108
  //#endregion
11664
- export { GO_TRANSPORT, 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, REDIS_CLIENT, SENTINEL, SUPAVISOR_CLIENT, SUPAVISOR_SERVER, UNDICI_CLIENT, UNDICI_TICK_MS, goLateSeconds, goTimerLateness, nodeEarlySeconds, nodeLateSeconds, nodeTimerLateness, undiciFastEarly, undiciFastLateness };
13109
+ export { AMQPLIB, ATEN_DETECTOR, GO_TRANSPORT, 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, UNDICI_CLIENT, UNDICI_TICK_MS, goLateSeconds, goTimerLateness, nodeEarlySeconds, nodeLateSeconds, nodeTimerLateness, undiciFastEarly, undiciFastLateness };
11665
13110
 
11666
13111
  //# sourceMappingURL=index.js.map