@mark1russell7/service 0.8.19 → 0.8.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/build/backoff.d.ts +44 -2
  2. package/build/{builder-zO48Vgoj.d.ts → builder.d.ts} +14 -101
  3. package/build/builder.js +499 -0
  4. package/build/builder.js.map +1 -0
  5. package/build/{call-context-DDhcVvn5.d.ts → call-context.d.ts} +3 -4
  6. package/build/channel.d.ts +1 -1
  7. package/build/{core-BSzt4RI2.d.ts → client/core.d.ts} +32 -61
  8. package/build/{machine-BhVeHr_m.js → client/core.js} +4 -153
  9. package/build/client/core.js.map +1 -0
  10. package/build/{dial-ChwIcvd4.d.ts → client/dial.d.ts} +3 -4
  11. package/build/client/dial.js +52 -0
  12. package/build/client/dial.js.map +1 -0
  13. package/build/client/machine.js +29 -0
  14. package/build/client/machine.js.map +1 -0
  15. package/build/client/meets.d.ts +35 -0
  16. package/build/client/meets.js +78 -0
  17. package/build/client/meets.js.map +1 -0
  18. package/build/clock.d.ts +1 -1
  19. package/build/conformance.d.ts +122 -0
  20. package/build/conformance.js +470 -0
  21. package/build/conformance.js.map +1 -0
  22. package/build/contract.d.ts +28 -0
  23. package/build/contract.js +184 -0
  24. package/build/contract.js.map +1 -0
  25. package/build/description.d.ts +161 -0
  26. package/build/description.js +11 -0
  27. package/build/description.js.map +1 -0
  28. package/build/drains.js +35 -0
  29. package/build/drains.js.map +1 -0
  30. package/build/events.d.ts +25 -0
  31. package/build/fakes.d.ts +43 -0
  32. package/build/fakes.js +93 -0
  33. package/build/fakes.js.map +1 -0
  34. package/build/grpc/client.d.ts +153 -0
  35. package/build/grpc/client.js +474 -0
  36. package/build/grpc/client.js.map +1 -0
  37. package/build/grpc/connection.d.ts +97 -0
  38. package/build/grpc/connection.js +59 -0
  39. package/build/grpc/connection.js.map +1 -0
  40. package/build/grpc/machine.d.ts +12 -0
  41. package/build/grpc/machine.js +149 -0
  42. package/build/grpc/machine.js.map +1 -0
  43. package/build/grpc/meets.d.ts +14 -0
  44. package/build/grpc/meets.js +105 -0
  45. package/build/grpc/meets.js.map +1 -0
  46. package/build/grpc/starting.d.ts +33 -0
  47. package/build/grpc/starting.js +89 -0
  48. package/build/grpc/starting.js.map +1 -0
  49. package/build/grpc.d.ts +9 -303
  50. package/build/grpc.js +7 -854
  51. package/build/health.d.ts +93 -0
  52. package/build/health.js +223 -0
  53. package/build/health.js.map +1 -0
  54. package/build/heartbeat.d.ts +1 -1
  55. package/build/host/discovery.d.ts +61 -0
  56. package/build/host/discovery.js +113 -0
  57. package/build/host/discovery.js.map +1 -0
  58. package/build/host/env.d.ts +14 -0
  59. package/build/host/env.js +57 -0
  60. package/build/host/env.js.map +1 -0
  61. package/build/host/fakes.d.ts +82 -0
  62. package/build/host/fakes.js +239 -0
  63. package/build/host/fakes.js.map +1 -0
  64. package/build/host/group.d.ts +142 -0
  65. package/build/host/group.js +517 -0
  66. package/build/host/group.js.map +1 -0
  67. package/build/host/install.d.ts +96 -0
  68. package/build/host/install.js +330 -0
  69. package/build/host/install.js.map +1 -0
  70. package/build/host/lock.d.ts +78 -0
  71. package/build/host/lock.js +190 -0
  72. package/build/host/lock.js.map +1 -0
  73. package/build/host/logs.d.ts +26 -0
  74. package/build/host/logs.js +48 -0
  75. package/build/host/logs.js.map +1 -0
  76. package/build/host/node.d.ts +14 -0
  77. package/build/host/node.js +309 -0
  78. package/build/host/node.js.map +1 -0
  79. package/build/{ports-B1ayTL-j.d.ts → host/ports.d.ts} +15 -16
  80. package/build/host/ports.js +17 -0
  81. package/build/host/ports.js.map +1 -0
  82. package/build/host/probes.d.ts +51 -0
  83. package/build/host/probes.js +139 -0
  84. package/build/host/probes.js.map +1 -0
  85. package/build/host/processes.d.ts +32 -0
  86. package/build/host/processes.js +63 -0
  87. package/build/host/processes.js.map +1 -0
  88. package/build/host/render.d.ts +84 -0
  89. package/build/host/render.js +235 -0
  90. package/build/host/render.js.map +1 -0
  91. package/build/host/watch.d.ts +90 -0
  92. package/build/host/watch.js +165 -0
  93. package/build/host/watch.js.map +1 -0
  94. package/build/host.d.ts +13 -671
  95. package/build/host.js +12 -2126
  96. package/build/http/answers.js +29 -0
  97. package/build/http/answers.js.map +1 -0
  98. package/build/http/fake-server.js +61 -0
  99. package/build/http/fake-server.js.map +1 -0
  100. package/build/http/outcome.d.ts +115 -0
  101. package/build/http/outcome.js +325 -0
  102. package/build/http/outcome.js.map +1 -0
  103. package/build/http/probes.d.ts +83 -0
  104. package/build/http/probes.js +232 -0
  105. package/build/http/probes.js.map +1 -0
  106. package/build/http/transport.d.ts +165 -0
  107. package/build/http/transport.js +517 -0
  108. package/build/http/transport.js.map +1 -0
  109. package/build/http-client/client.d.ts +121 -0
  110. package/build/http-client/client.js +330 -0
  111. package/build/http-client/client.js.map +1 -0
  112. package/build/http-client/connection.d.ts +78 -0
  113. package/build/http-client/connection.js +54 -0
  114. package/build/http-client/connection.js.map +1 -0
  115. package/build/http-client/machine.d.ts +14 -0
  116. package/build/http-client/machine.js +109 -0
  117. package/build/http-client/machine.js.map +1 -0
  118. package/build/http-client/meets.d.ts +11 -0
  119. package/build/http-client/meets.js +74 -0
  120. package/build/http-client/meets.js.map +1 -0
  121. package/build/http-client/session.d.ts +87 -0
  122. package/build/http-client/session.js +99 -0
  123. package/build/http-client/session.js.map +1 -0
  124. package/build/http-client/starting.d.ts +25 -0
  125. package/build/http-client/starting.js +65 -0
  126. package/build/http-client/starting.js.map +1 -0
  127. package/build/http-client.d.ts +9 -330
  128. package/build/http-client.js +8 -707
  129. package/build/http.d.ts +5 -353
  130. package/build/http.js +3 -1086
  131. package/build/identity.d.ts +16 -0
  132. package/build/identity.js +44 -0
  133. package/build/identity.js.map +1 -0
  134. package/build/index.d.ts +35 -412
  135. package/build/index.js +24 -3277
  136. package/build/knobs.d.ts +1 -0
  137. package/build/{knobs-BJcz6m01.js → knobs.js} +2 -34
  138. package/build/knobs.js.map +1 -0
  139. package/build/latch.d.ts +29 -0
  140. package/build/latch.js +122 -0
  141. package/build/latch.js.map +1 -0
  142. package/build/{rules-HyFCBStQ.d.ts → law.d.ts} +19 -37
  143. package/build/law.js +149 -0
  144. package/build/law.js.map +1 -0
  145. package/build/lifecycle.d.ts +144 -0
  146. package/build/lifecycle.js +411 -0
  147. package/build/lifecycle.js.map +1 -0
  148. package/build/limiter/machine.d.ts +40 -0
  149. package/build/limiter/machine.js +279 -0
  150. package/build/limiter/machine.js.map +1 -0
  151. package/build/{policy-CBcK2XGg.d.ts → limiter/policy.d.ts} +28 -29
  152. package/build/{policy-UYALkqVq.js → limiter/policy.js} +10 -9
  153. package/build/limiter/policy.js.map +1 -0
  154. package/build/{limiter-BNKnwzeY.d.ts → limiter/quota.d.ts} +32 -74
  155. package/build/{limiter-DrM0PQV9.js → limiter/quota.js} +3 -418
  156. package/build/limiter/quota.js.map +1 -0
  157. package/build/{store-DFwFKrsB.d.ts → limiter/store.d.ts} +10 -11
  158. package/build/limiter/store.js +145 -0
  159. package/build/limiter/store.js.map +1 -0
  160. package/build/limiter.d.ts +4 -3
  161. package/build/limiter.js +4 -2
  162. package/build/lint.d.ts +152 -0
  163. package/build/lint.js +576 -0
  164. package/build/lint.js.map +1 -0
  165. package/build/logger.d.ts +71 -0
  166. package/build/logger.js +183 -0
  167. package/build/logger.js.map +1 -0
  168. package/build/machines.d.ts +41 -0
  169. package/build/machines.js +451 -0
  170. package/build/machines.js.map +1 -0
  171. package/build/metrics.d.ts +53 -0
  172. package/build/metrics.js +111 -0
  173. package/build/metrics.js.map +1 -0
  174. package/build/mongodb/client.d.ts +131 -0
  175. package/build/mongodb/client.js +388 -0
  176. package/build/mongodb/client.js.map +1 -0
  177. package/build/mongodb/connection.d.ts +112 -0
  178. package/build/mongodb/connection.js +12 -0
  179. package/build/mongodb/connection.js.map +1 -0
  180. package/build/mongodb/machine.d.ts +14 -0
  181. package/build/mongodb/machine.js +122 -0
  182. package/build/mongodb/machine.js.map +1 -0
  183. package/build/mongodb/meets.d.ts +15 -0
  184. package/build/mongodb/meets.js +103 -0
  185. package/build/mongodb/meets.js.map +1 -0
  186. package/build/mongodb/starting.d.ts +29 -0
  187. package/build/mongodb/starting.js +77 -0
  188. package/build/mongodb/starting.js.map +1 -0
  189. package/build/mongodb.d.ts +8 -296
  190. package/build/mongodb.js +7 -682
  191. package/build/operation.d.ts +27 -0
  192. package/build/{operation-DF73RZOI.js → operation.js} +2 -2
  193. package/build/operation.js.map +1 -0
  194. package/build/otel.d.ts +2 -2
  195. package/build/pg/client.d.ts +96 -0
  196. package/build/pg/client.js +277 -0
  197. package/build/pg/client.js.map +1 -0
  198. package/build/pg/connection.d.ts +75 -0
  199. package/build/pg/connection.js +11 -0
  200. package/build/pg/connection.js.map +1 -0
  201. package/build/pg/machine.d.ts +13 -0
  202. package/build/pg/machine.js +111 -0
  203. package/build/pg/machine.js.map +1 -0
  204. package/build/pg/meets.d.ts +14 -0
  205. package/build/pg/meets.js +83 -0
  206. package/build/pg/meets.js.map +1 -0
  207. package/build/pg/starting.d.ts +26 -0
  208. package/build/pg/starting.js +62 -0
  209. package/build/pg/starting.js.map +1 -0
  210. package/build/pg.d.ts +8 -219
  211. package/build/pg.js +7 -525
  212. package/build/poller.d.ts +9 -0
  213. package/build/poller.js +152 -0
  214. package/build/poller.js.map +1 -0
  215. package/build/process.d.ts +114 -0
  216. package/build/process.js +170 -0
  217. package/build/process.js.map +1 -0
  218. package/build/profiles.d.ts +68 -0
  219. package/build/profiles.js +120 -0
  220. package/build/profiles.js.map +1 -0
  221. package/build/{queue-DXdw1vLO.d.ts → queue.d.ts} +16 -29
  222. package/build/queue.js +279 -0
  223. package/build/queue.js.map +1 -0
  224. package/build/rabbitmq/client.d.ts +144 -0
  225. package/build/rabbitmq/client.js +426 -0
  226. package/build/rabbitmq/client.js.map +1 -0
  227. package/build/rabbitmq/connection.d.ts +91 -0
  228. package/build/rabbitmq/connection.js +15 -0
  229. package/build/rabbitmq/connection.js.map +1 -0
  230. package/build/rabbitmq/machine.d.ts +13 -0
  231. package/build/rabbitmq/machine.js +159 -0
  232. package/build/rabbitmq/machine.js.map +1 -0
  233. package/build/rabbitmq/meets.d.ts +12 -0
  234. package/build/rabbitmq/meets.js +96 -0
  235. package/build/rabbitmq/meets.js.map +1 -0
  236. package/build/rabbitmq/starting.d.ts +27 -0
  237. package/build/rabbitmq/starting.js +67 -0
  238. package/build/rabbitmq/starting.js.map +1 -0
  239. package/build/rabbitmq.d.ts +8 -283
  240. package/build/rabbitmq.js +7 -742
  241. package/build/redis/client.d.ts +86 -0
  242. package/build/redis/client.js +285 -0
  243. package/build/redis/client.js.map +1 -0
  244. package/build/redis/connection.d.ts +57 -0
  245. package/build/redis/connection.js +11 -0
  246. package/build/redis/connection.js.map +1 -0
  247. package/build/redis/limiter.d.ts +43 -0
  248. package/build/redis/limiter.js +164 -0
  249. package/build/redis/limiter.js.map +1 -0
  250. package/build/redis/machine.d.ts +12 -0
  251. package/build/redis/machine.js +144 -0
  252. package/build/redis/machine.js.map +1 -0
  253. package/build/redis/meets.d.ts +11 -0
  254. package/build/redis/meets.js +75 -0
  255. package/build/redis/meets.js.map +1 -0
  256. package/build/redis/operations.d.ts +5 -0
  257. package/build/redis/operations.js +114 -0
  258. package/build/redis/operations.js.map +1 -0
  259. package/build/redis.d.ts +10 -207
  260. package/build/redis.js +9 -771
  261. package/build/requests.d.ts +66 -0
  262. package/build/requests.js +279 -0
  263. package/build/requests.js.map +1 -0
  264. package/build/retrier.d.ts +62 -0
  265. package/build/{retrier-Dnjhvxol.js → retrier.js} +2 -2
  266. package/build/retrier.js.map +1 -0
  267. package/build/routes.d.ts +35 -0
  268. package/build/routes.js +77 -0
  269. package/build/routes.js.map +1 -0
  270. package/build/rules.d.ts +19 -2
  271. package/build/stops.d.ts +51 -0
  272. package/build/stops.js +86 -0
  273. package/build/stops.js.map +1 -0
  274. package/build/testing.d.ts +8 -270
  275. package/build/testing.js +4 -1027
  276. package/build/testing.js.map +1 -1
  277. package/build/timing.d.ts +63 -0
  278. package/build/{timing-DZl36uXs.js → timing.js} +2 -2
  279. package/build/timing.js.map +1 -0
  280. package/build/units.d.ts +17 -0
  281. package/build/units.js +236 -0
  282. package/build/units.js.map +1 -0
  283. package/build/watchdog.d.ts +34 -0
  284. package/build/watchdog.js +53 -0
  285. package/build/watchdog.js.map +1 -0
  286. package/build/websocket/client.d.ts +136 -0
  287. package/build/websocket/client.js +422 -0
  288. package/build/websocket/client.js.map +1 -0
  289. package/build/websocket/connection.d.ts +83 -0
  290. package/build/websocket/connection.js +57 -0
  291. package/build/websocket/connection.js.map +1 -0
  292. package/build/websocket/machine.d.ts +12 -0
  293. package/build/websocket/machine.js +155 -0
  294. package/build/websocket/machine.js.map +1 -0
  295. package/build/websocket/meets.d.ts +14 -0
  296. package/build/websocket/meets.js +92 -0
  297. package/build/websocket/meets.js.map +1 -0
  298. package/build/websocket/starting.d.ts +25 -0
  299. package/build/websocket/starting.js +69 -0
  300. package/build/websocket/starting.js.map +1 -0
  301. package/build/websocket.d.ts +9 -264
  302. package/build/websocket.js +8 -774
  303. package/build/worker.d.ts +92 -0
  304. package/build/worker.js +153 -0
  305. package/build/worker.js.map +1 -0
  306. package/package.json +4 -3
  307. package/build/backoff-QTRGfkEK.d.ts +0 -45
  308. package/build/clock-DpVgpY4h.d.ts +0 -2
  309. package/build/grpc.js.map +0 -1
  310. package/build/host.js.map +0 -1
  311. package/build/http-client.js.map +0 -1
  312. package/build/http.js.map +0 -1
  313. package/build/index.js.map +0 -1
  314. package/build/knobs-BJcz6m01.js.map +0 -1
  315. package/build/lifecycle-D0J-zwZF.d.ts +0 -374
  316. package/build/limiter-DrM0PQV9.js.map +0 -1
  317. package/build/logger-B6drv9w0.d.ts +0 -488
  318. package/build/machine-BhVeHr_m.js.map +0 -1
  319. package/build/mongodb.js.map +0 -1
  320. package/build/operation-DF73RZOI.js.map +0 -1
  321. package/build/pg.js.map +0 -1
  322. package/build/policy-UYALkqVq.js.map +0 -1
  323. package/build/process-7R9M29wN.js +0 -437
  324. package/build/process-7R9M29wN.js.map +0 -1
  325. package/build/rabbitmq.js.map +0 -1
  326. package/build/redis.js.map +0 -1
  327. package/build/requests-DD2ALv0_.js +0 -583
  328. package/build/requests-DD2ALv0_.js.map +0 -1
  329. package/build/retrier-Dnjhvxol.js.map +0 -1
  330. package/build/timing-DZl36uXs.js.map +0 -1
  331. package/build/websocket.js.map +0 -1
@@ -0,0 +1,159 @@
1
+ import { clientKnob, closeTimer, transition } from "../client/machine.js";
2
+ // src/rabbitmq/machine.ts
3
+ /** The states where a generation is open, and the states where the client can close. */
4
+ const OPEN = ["ready", "blocked"];
5
+ const SERVING = [
6
+ "connecting",
7
+ ...OPEN,
8
+ "failing"
9
+ ];
10
+ const LIVE = [...SERVING, "closing"];
11
+ /**
12
+ * The RabbitMQ client of the service as a `mark1russell7.machine/1` document. It is one generation
13
+ * at a time: one connection of amqplib and its confirm channel. The machines `amqplib` and
14
+ * `rabbitmq-connection` of `@mark1russell7/machines` give the connection and its heartbeat. The states:
15
+ * - `ready`: the channel is open, and the client sends each call.
16
+ * - `blocked`: a resource alarm of the broker blocked the connection. Each call is not sent until the unblock.
17
+ * - `failing`: no generation is open. The client tries the next node after its backoff.
18
+ *
19
+ * The end of the channel or of the connection ends the generation. A test records the transitions
20
+ * of the client and replays them against this document.
21
+ */
22
+ const RABBIT_CLIENT_MACHINE = {
23
+ format: "mark1russell7.machine/1",
24
+ id: "service.machine.rabbitmq-client",
25
+ title: "The RabbitMQ client of the service, over amqplib 2",
26
+ layer: "driver",
27
+ version: "0.1.0",
28
+ sources: [{
29
+ ref: "packages/service/src/rabbitmq (the client implements this document)",
30
+ rung: "implemented"
31
+ }],
32
+ states: {
33
+ none: {
34
+ initial: true,
35
+ note: "the client exists, and its first connection does not"
36
+ },
37
+ connecting: { note: "a connection, its handshake, and the open of its confirm channel, in connect_bound" },
38
+ ready: { note: "the channel is open. A black hole stays hidden until the heartbeat or a timer of a call ends it" },
39
+ blocked: { note: "a resource alarm blocked the connection: the broker does not read its socket" },
40
+ failing: { note: "no generation is open. The client tries the next node after its backoff" },
41
+ closing: { note: "connection.close, in close_bound, then a destroy of the socket" },
42
+ end: {
43
+ final: true,
44
+ note: "the service closed the client"
45
+ }
46
+ },
47
+ events: {
48
+ "status.connecting": { kind: "local" },
49
+ join: {
50
+ kind: "rx",
51
+ note: "the confirm channel is open: a new generation (D1)"
52
+ },
53
+ "connect.failed": {
54
+ kind: "local",
55
+ note: "the connection or its channel failed, or did not open in connect_bound"
56
+ },
57
+ "retry.connect": {
58
+ kind: "timer",
59
+ note: "the backoff ended: a try on the next node"
60
+ },
61
+ "connection.error": {
62
+ kind: "rx",
63
+ note: "an error event of the connection. Its close follows"
64
+ },
65
+ "connection.end": {
66
+ kind: "rx",
67
+ note: "the connection closed: a reset, a FIN, the heartbeat, or a close of the broker"
68
+ },
69
+ "channel.error": {
70
+ kind: "rx",
71
+ note: "the broker closed the channel with a reply code"
72
+ },
73
+ "channel.end": {
74
+ kind: "rx",
75
+ note: "the channel closed on a connection that stays: the client closes that connection too"
76
+ },
77
+ "connection.blocked": {
78
+ kind: "rx",
79
+ note: "connection.blocked of the broker: a resource alarm"
80
+ },
81
+ "connection.unblocked": { kind: "rx" },
82
+ "command.reissue": { kind: "local" },
83
+ "close.request": { kind: "local" },
84
+ "close.bound": {
85
+ kind: "timer",
86
+ note: "connection.close got no close-ok in close_bound"
87
+ },
88
+ "close.destroy": {
89
+ kind: "local",
90
+ note: "the bound destroys a socket that a silent broker does not close"
91
+ },
92
+ "status.end": { kind: "local" }
93
+ },
94
+ knobs: {
95
+ connect_bound: clientKnob("socketOptions.timeout"),
96
+ heartbeat_interval: clientKnob("heartbeat"),
97
+ retry_base: clientKnob("retry.base"),
98
+ retry_cap: clientKnob("retry.cap"),
99
+ close_bound: clientKnob("close.bound")
100
+ },
101
+ timers: {
102
+ connect_timeout: {
103
+ duration: {
104
+ knob: "connect_bound",
105
+ unit: "s"
106
+ },
107
+ arms: ["enter:connecting"],
108
+ cancels: ["join", "connect.failed"],
109
+ fires: "connect.failed",
110
+ note: "the bound of the wrapper on the connection and its channel. amqplib bounds the connect and the handshake with the same time"
111
+ },
112
+ heartbeat: {
113
+ duration: {
114
+ expr: "3 * heartbeat_interval",
115
+ unit: "s"
116
+ },
117
+ arms: ["join"],
118
+ cancels: ["connection.end", "close.request"],
119
+ fires: "connection.end",
120
+ note: "the heartbeat of amqplib ends a silent connection 2 to 3 heartbeats after the last data. Each frame that arrives starts it again"
121
+ },
122
+ retry: {
123
+ duration: {
124
+ expr: "min(retry_cap, retry_base * pow(2, fired)) + retry_base",
125
+ unit: "s"
126
+ },
127
+ arms: [
128
+ "connect.failed",
129
+ "connection.end",
130
+ "channel.end"
131
+ ],
132
+ cancels: ["close.request"],
133
+ fires: "retry.connect",
134
+ backoff: { resets: ["join"] },
135
+ note: "the most delay: the backoff doubles from retry_base to retry_cap, with a jitter up to retry_base"
136
+ },
137
+ close: closeTimer()
138
+ },
139
+ transitions: [
140
+ transition("connect", "none", "status.connecting", "connecting"),
141
+ transition("join", "connecting", "join", "ready"),
142
+ transition("connect-failed", "connecting", "connect.failed", "failing", { timer: "connect_timeout" }),
143
+ transition("retry", "failing", "retry.connect", "connecting", { timer: "retry" }),
144
+ transition("connection-end", [...OPEN], "connection.end", "failing", { timer: "heartbeat" }),
145
+ transition("channel-end", [...OPEN], "channel.end", "failing"),
146
+ transition("blocked", "ready", "connection.blocked", "blocked"),
147
+ transition("unblocked", "blocked", "connection.unblocked", "ready"),
148
+ ...OPEN.map((state) => transition(`connection-error-${state}`, state, "connection.error", state)),
149
+ ...OPEN.map((state) => transition(`channel-error-${state}`, state, "channel.error", state)),
150
+ ...LIVE.map((state) => transition(`reissue-${state}`, state, "command.reissue", state)),
151
+ transition("close", [...SERVING], "close.request", "closing"),
152
+ transition("close-bound", "closing", "close.bound", "closing", { timer: "close" }),
153
+ transition("close-destroy", "closing", "close.destroy", "closing"),
154
+ transition("end", "closing", "status.end", "end")
155
+ ]
156
+ };
157
+ export { RABBIT_CLIENT_MACHINE };
158
+
159
+ //# sourceMappingURL=machine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machine.js","names":["knob","t"],"sources":["../../src/rabbitmq/machine.ts"],"sourcesContent":["import type { Machine } from \"@mark1russell7/algebra\";\nimport { clientKnob as knob, closeTimer, transition as t } from \"../client/machine.ts\";\n\n/** The states where a generation is open, and the states where the client can close. */\nconst OPEN = [\"ready\", \"blocked\"] as const;\nconst SERVING = [\"connecting\", ...OPEN, \"failing\"] as const;\nconst LIVE = [...SERVING, \"closing\"] as const;\n\n/**\n * The RabbitMQ client of the service as a `mark1russell7.machine/1` document. It is one generation\n * at a time: one connection of amqplib and its confirm channel. The machines `amqplib` and\n * `rabbitmq-connection` of `@mark1russell7/machines` give the connection and its heartbeat. The states:\n * - `ready`: the channel is open, and the client sends each call.\n * - `blocked`: a resource alarm of the broker blocked the connection. Each call is not sent until the unblock.\n * - `failing`: no generation is open. The client tries the next node after its backoff.\n *\n * The end of the channel or of the connection ends the generation. A test records the transitions\n * of the client and replays them against this document.\n */\nexport const RABBIT_CLIENT_MACHINE: Machine = {\n format: \"mark1russell7.machine/1\",\n id: \"service.machine.rabbitmq-client\",\n title: \"The RabbitMQ client of the service, over amqplib 2\",\n layer: \"driver\",\n version: \"0.1.0\",\n sources: [{ ref: \"packages/service/src/rabbitmq (the client implements this document)\", rung: \"implemented\" }],\n states: {\n none: { initial: true, note: \"the client exists, and its first connection does not\" },\n connecting: { note: \"a connection, its handshake, and the open of its confirm channel, in connect_bound\" },\n ready: { note: \"the channel is open. A black hole stays hidden until the heartbeat or a timer of a call ends it\" },\n blocked: { note: \"a resource alarm blocked the connection: the broker does not read its socket\" },\n failing: { note: \"no generation is open. The client tries the next node after its backoff\" },\n closing: { note: \"connection.close, in close_bound, then a destroy of the socket\" },\n end: { final: true, note: \"the service closed the client\" },\n },\n events: {\n \"status.connecting\": { kind: \"local\" },\n join: { kind: \"rx\", note: \"the confirm channel is open: a new generation (D1)\" },\n \"connect.failed\": { kind: \"local\", note: \"the connection or its channel failed, or did not open in connect_bound\" },\n \"retry.connect\": { kind: \"timer\", note: \"the backoff ended: a try on the next node\" },\n \"connection.error\": { kind: \"rx\", note: \"an error event of the connection. Its close follows\" },\n \"connection.end\": { kind: \"rx\", note: \"the connection closed: a reset, a FIN, the heartbeat, or a close of the broker\" },\n \"channel.error\": { kind: \"rx\", note: \"the broker closed the channel with a reply code\" },\n \"channel.end\": { kind: \"rx\", note: \"the channel closed on a connection that stays: the client closes that connection too\" },\n \"connection.blocked\": { kind: \"rx\", note: \"connection.blocked of the broker: a resource alarm\" },\n \"connection.unblocked\": { kind: \"rx\" },\n \"command.reissue\": { kind: \"local\" },\n \"close.request\": { kind: \"local\" },\n \"close.bound\": { kind: \"timer\", note: \"connection.close got no close-ok in close_bound\" },\n \"close.destroy\": { kind: \"local\", note: \"the bound destroys a socket that a silent broker does not close\" },\n \"status.end\": { kind: \"local\" },\n },\n knobs: {\n connect_bound: knob(\"socketOptions.timeout\"),\n heartbeat_interval: knob(\"heartbeat\"),\n retry_base: knob(\"retry.base\"),\n retry_cap: knob(\"retry.cap\"),\n close_bound: knob(\"close.bound\"),\n },\n timers: {\n connect_timeout: {\n duration: { knob: \"connect_bound\", unit: \"s\" },\n arms: [\"enter:connecting\"],\n cancels: [\"join\", \"connect.failed\"],\n fires: \"connect.failed\",\n note: \"the bound of the wrapper on the connection and its channel. amqplib bounds the connect and the handshake with the same time\",\n },\n heartbeat: {\n duration: { expr: \"3 * heartbeat_interval\", unit: \"s\" },\n arms: [\"join\"],\n cancels: [\"connection.end\", \"close.request\"],\n fires: \"connection.end\",\n note: \"the heartbeat of amqplib ends a silent connection 2 to 3 heartbeats after the last data. Each frame that arrives starts it again\",\n },\n retry: {\n duration: { expr: \"min(retry_cap, retry_base * pow(2, fired)) + retry_base\", unit: \"s\" },\n arms: [\"connect.failed\", \"connection.end\", \"channel.end\"],\n cancels: [\"close.request\"],\n fires: \"retry.connect\",\n backoff: { resets: [\"join\"] },\n note: \"the most delay: the backoff doubles from retry_base to retry_cap, with a jitter up to retry_base\",\n },\n close: closeTimer(),\n },\n transitions: [\n t(\"connect\", \"none\", \"status.connecting\", \"connecting\"),\n t(\"join\", \"connecting\", \"join\", \"ready\"),\n t(\"connect-failed\", \"connecting\", \"connect.failed\", \"failing\", { timer: \"connect_timeout\" }),\n t(\"retry\", \"failing\", \"retry.connect\", \"connecting\", { timer: \"retry\" }),\n t(\"connection-end\", [...OPEN], \"connection.end\", \"failing\", { timer: \"heartbeat\" }),\n t(\"channel-end\", [...OPEN], \"channel.end\", \"failing\"),\n t(\"blocked\", \"ready\", \"connection.blocked\", \"blocked\"),\n t(\"unblocked\", \"blocked\", \"connection.unblocked\", \"ready\"),\n ...OPEN.map((state) => t(`connection-error-${state}`, state, \"connection.error\", state)),\n ...OPEN.map((state) => t(`channel-error-${state}`, state, \"channel.error\", state)),\n ...LIVE.map((state) => t(`reissue-${state}`, state, \"command.reissue\", state)),\n t(\"close\", [...SERVING], \"close.request\", \"closing\"),\n t(\"close-bound\", \"closing\", \"close.bound\", \"closing\", { timer: \"close\" }),\n t(\"close-destroy\", \"closing\", \"close.destroy\", \"closing\"),\n t(\"end\", \"closing\", \"status.end\", \"end\"),\n ],\n};\n"],"mappings":"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"}
@@ -0,0 +1,12 @@
1
+ import { Meeting } from "../client/meets.js";
2
+ import { RabbitKnobs } from "./client.js";
3
+ /**
4
+ * This function gives the manifestations that a RabbitMQ client can meet, and the detectors of each,
5
+ * from its knobs. The cells of R3 measured them on amqplib 2.2.0 against RabbitMQ 4.3.6:
6
+ * - The heartbeat ends a silent connection 2 to 3 heartbeats after the last data. The cells measured
7
+ * 180.009 s at 60 s, and 45.009 s at 15 s (O17). It finds a silent broker in flight and idle.
8
+ * - A stopped broker resets each client at once, because each socket of RabbitMQ has linger 0.
9
+ * - At `tcp_retries2 = 7`, the kernel gave up at 53.016 s.
10
+ * - A broker with a resource alarm blocks each connection that publishes, and it still sends its heartbeats.
11
+ */
12
+ export declare const rabbitMeetings: (name: string, knobs: RabbitKnobs) => Meeting[];
@@ -0,0 +1,96 @@
1
+ import { NEVER, WHAT, immediate, keepaliveAnswered, keepaliveReset, keepaliveSilent, kernelGiveUp } from "../client/meets.js";
2
+ import { finiteMs } from "../client/core.js";
3
+ import { quantity } from "@mark1russell7/quantity";
4
+ // src/rabbitmq/meets.ts
5
+ /**
6
+ * This function gives the manifestations that a RabbitMQ client can meet, and the detectors of each,
7
+ * from its knobs. The cells of R3 measured them on amqplib 2.2.0 against RabbitMQ 4.3.6:
8
+ * - The heartbeat ends a silent connection 2 to 3 heartbeats after the last data. The cells measured
9
+ * 180.009 s at 60 s, and 45.009 s at 15 s (O17). It finds a silent broker in flight and idle.
10
+ * - A stopped broker resets each client at once, because each socket of RabbitMQ has linger 0.
11
+ * - At `tcp_retries2 = 7`, the kernel gave up at 53.016 s.
12
+ * - A broker with a resource alarm blocks each connection that publishes, and it still sends its heartbeats.
13
+ */
14
+ const rabbitMeetings = (name, knobs) => {
15
+ const beat = finiteMs(knobs.heartbeat_interval);
16
+ const detection = beat === void 0 ? NEVER : quantity(3 * beat / 1e3, "s");
17
+ const heartbeat = (situation) => ({
18
+ by: "heartbeat_detection_time",
19
+ within: detection,
20
+ situation,
21
+ effect: `the heartbeat of amqplib ends the connection, each call in flight fails as indeterminate, and ${name} connects again`
22
+ });
23
+ const call = {
24
+ by: "request_timeout",
25
+ within: knobs.request_timeout,
26
+ situation: "in flight",
27
+ effect: "the timer of the wrapper ends the call as indeterminate, and the connection stays"
28
+ };
29
+ const giveUp = kernelGiveUp(knobs.retrans_giveup_time, "each call in flight fails as indeterminate");
30
+ const silent = (manifestation) => ({
31
+ manifestation,
32
+ what: WHAT[manifestation],
33
+ detectors: [
34
+ call,
35
+ heartbeat("in flight"),
36
+ giveUp,
37
+ heartbeat("idle"),
38
+ keepaliveSilent(knobs.keepalive_idle)
39
+ ]
40
+ });
41
+ return [
42
+ {
43
+ manifestation: "rst",
44
+ what: WHAT.rst,
45
+ detectors: [
46
+ immediate("in flight", "the call fails with ECONNRESET as indeterminate, and the client connects again"),
47
+ {
48
+ by: "heartbeat_interval",
49
+ within: beat === void 0 ? NEVER : knobs.heartbeat_interval,
50
+ situation: "idle",
51
+ effect: "the next heartbeat frame of the client gets a reset, and the client connects again"
52
+ },
53
+ keepaliveReset(knobs.keepalive_idle)
54
+ ]
55
+ },
56
+ {
57
+ manifestation: "fin",
58
+ what: WHAT.fin,
59
+ detectors: [immediate("in flight", "the broker closes its socket with linger 0, thus a reset arrives, and the call fails as indeterminate"), immediate("idle", "the reset of the broker arrives, and the client connects again")]
60
+ },
61
+ silent("blackhole"),
62
+ silent("freeze-host"),
63
+ {
64
+ manifestation: "freeze-process",
65
+ what: WHAT["freeze-process"],
66
+ detectors: [
67
+ call,
68
+ heartbeat("in flight"),
69
+ heartbeat("idle"),
70
+ keepaliveAnswered()
71
+ ]
72
+ },
73
+ {
74
+ manifestation: "app-stall",
75
+ what: "the broker stops its confirms and its replies for a time, and still sends its heartbeats: a resource alarm, or a quorum queue with no leader",
76
+ detectors: [
77
+ call,
78
+ {
79
+ by: "connection.blocked",
80
+ within: quantity(0, "s"),
81
+ situation: "idle",
82
+ effect: "a resource alarm blocks a connection that publishes at once. The client then refuses each call as not sent, until the unblock"
83
+ },
84
+ {
85
+ ...heartbeat("idle"),
86
+ within: NEVER,
87
+ effect: "the broker still sends its heartbeats"
88
+ },
89
+ keepaliveAnswered()
90
+ ]
91
+ }
92
+ ];
93
+ };
94
+ export { rabbitMeetings };
95
+
96
+ //# sourceMappingURL=meets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meets.js","names":[],"sources":["../../src/rabbitmq/meets.ts"],"sourcesContent":["import type { Extent } from \"@mark1russell7/quantity\";\nimport { quantity } from \"@mark1russell7/quantity\";\nimport type { Detector, Meeting, Situation } from \"../client/meets.ts\";\nimport { NEVER, WHAT, immediate, keepaliveAnswered, keepaliveReset, keepaliveSilent, kernelGiveUp } from \"../client/meets.ts\";\nimport { finiteMs } from \"../client/core.ts\";\nimport type { RabbitKnobs } from \"./client.ts\";\n\n/**\n * This function gives the manifestations that a RabbitMQ client can meet, and the detectors of each,\n * from its knobs. The cells of R3 measured them on amqplib 2.2.0 against RabbitMQ 4.3.6:\n * - The heartbeat ends a silent connection 2 to 3 heartbeats after the last data. The cells measured\n * 180.009 s at 60 s, and 45.009 s at 15 s (O17). It finds a silent broker in flight and idle.\n * - A stopped broker resets each client at once, because each socket of RabbitMQ has linger 0.\n * - At `tcp_retries2 = 7`, the kernel gave up at 53.016 s.\n * - A broker with a resource alarm blocks each connection that publishes, and it still sends its heartbeats.\n */\nexport const rabbitMeetings = (name: string, knobs: RabbitKnobs): Meeting[] => {\n const beat = finiteMs(knobs.heartbeat_interval);\n const detection: Extent = beat === undefined ? NEVER : quantity((3 * beat) / 1000, \"s\");\n const heartbeat = (situation: Situation): Detector => ({\n by: \"heartbeat_detection_time\",\n within: detection,\n situation,\n effect: `the heartbeat of amqplib ends the connection, each call in flight fails as indeterminate, and ${name} connects again`,\n });\n const call: Detector = {\n by: \"request_timeout\",\n within: knobs.request_timeout,\n situation: \"in flight\",\n effect: \"the timer of the wrapper ends the call as indeterminate, and the connection stays\",\n };\n const giveUp = kernelGiveUp(knobs.retrans_giveup_time, \"each call in flight fails as indeterminate\");\n const silent = (manifestation: \"blackhole\" | \"freeze-host\"): Meeting => ({\n manifestation,\n what: WHAT[manifestation],\n detectors: [call, heartbeat(\"in flight\"), giveUp, heartbeat(\"idle\"), keepaliveSilent(knobs.keepalive_idle)],\n });\n return [\n {\n manifestation: \"rst\",\n what: WHAT.rst,\n detectors: [\n immediate(\"in flight\", \"the call fails with ECONNRESET as indeterminate, and the client connects again\"),\n {\n by: \"heartbeat_interval\",\n within: beat === undefined ? NEVER : knobs.heartbeat_interval,\n situation: \"idle\",\n effect: \"the next heartbeat frame of the client gets a reset, and the client connects again\",\n },\n keepaliveReset(knobs.keepalive_idle),\n ],\n },\n {\n manifestation: \"fin\",\n what: WHAT.fin,\n detectors: [\n immediate(\"in flight\", \"the broker closes its socket with linger 0, thus a reset arrives, and the call fails as indeterminate\"),\n immediate(\"idle\", \"the reset of the broker arrives, and the client connects again\"),\n ],\n },\n silent(\"blackhole\"),\n silent(\"freeze-host\"),\n {\n manifestation: \"freeze-process\",\n what: WHAT[\"freeze-process\"],\n detectors: [call, heartbeat(\"in flight\"), heartbeat(\"idle\"), keepaliveAnswered()],\n },\n {\n manifestation: \"app-stall\",\n what: \"the broker stops its confirms and its replies for a time, and still sends its heartbeats: a resource alarm, or a quorum queue with no leader\",\n detectors: [\n call,\n {\n by: \"connection.blocked\",\n within: quantity(0, \"s\"),\n situation: \"idle\",\n effect: \"a resource alarm blocks a connection that publishes at once. The client then refuses each call as not sent, until the unblock\",\n },\n { ...heartbeat(\"idle\"), within: NEVER, effect: \"the broker still sends its heartbeats\" },\n keepaliveAnswered(),\n ],\n },\n ];\n};\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAa,kBAAkB,MAAc,UAAkC;CAC7E,MAAM,OAAO,SAAS,MAAM,kBAAkB;CAC9C,MAAM,YAAoB,SAAS,KAAA,IAAY,QAAQ,SAAU,IAAI,OAAQ,KAAM,GAAG;CACtF,MAAM,aAAa,eAAoC;EACrD,IAAI;EACJ,QAAQ;EACR;EACA,QAAQ,iGAAiG,KAAK;CAChH;CACA,MAAM,OAAiB;EACrB,IAAI;EACJ,QAAQ,MAAM;EACd,WAAW;EACX,QAAQ;CACV;CACA,MAAM,SAAS,aAAa,MAAM,qBAAqB,4CAA4C;CACnG,MAAM,UAAU,mBAAyD;EACvE;EACA,MAAM,KAAK;EACX,WAAW;GAAC;GAAM,UAAU,WAAW;GAAG;GAAQ,UAAU,MAAM;GAAG,gBAAgB,MAAM,cAAc;EAAC;CAC5G;CACA,OAAO;EACL;GACE,eAAe;GACf,MAAM,KAAK;GACX,WAAW;IACT,UAAU,aAAa,gFAAgF;IACvG;KACE,IAAI;KACJ,QAAQ,SAAS,KAAA,IAAY,QAAQ,MAAM;KAC3C,WAAW;KACX,QAAQ;IACV;IACA,eAAe,MAAM,cAAc;GACrC;EACF;EACA;GACE,eAAe;GACf,MAAM,KAAK;GACX,WAAW,CACT,UAAU,aAAa,uGAAuG,GAC9H,UAAU,QAAQ,gEAAgE,CACpF;EACF;EACA,OAAO,WAAW;EAClB,OAAO,aAAa;EACpB;GACE,eAAe;GACf,MAAM,KAAK;GACX,WAAW;IAAC;IAAM,UAAU,WAAW;IAAG,UAAU,MAAM;IAAG,kBAAkB;GAAC;EAClF;EACA;GACE,eAAe;GACf,MAAM;GACN,WAAW;IACT;IACA;KACE,IAAI;KACJ,QAAQ,SAAS,GAAG,GAAG;KACvB,WAAW;KACX,QAAQ;IACV;IACA;KAAE,GAAG,UAAU,MAAM;KAAG,QAAQ;KAAO,QAAQ;IAAwC;IACvF,kBAAkB;GACpB;EACF;CACF;AACF"}
@@ -0,0 +1,27 @@
1
+ import { Poll } from "../timing.js";
2
+ import { RabbitKnobs } from "./client.js";
3
+ /**
4
+ * This poll is the poll of the checks that `RABBIT_STARTING_KNOBS` fits. It is `STARTING_POLL` of
5
+ * the core: each 5 s with a jitter of 20 %, and a timeout of 4 s (B6, O12). The poll does not depend on the driver.
6
+ */
7
+ export declare const RABBIT_STARTING_POLL: Poll;
8
+ /**
9
+ * These knobs are a declaration to start from, from what the cells of R3 measured on amqplib 2.2.0
10
+ * against RabbitMQ 4.3.6. The runtime has no defaults: a service gives these knobs, or its own.
11
+ * Each value holds the borders that the cells measured:
12
+ * - `connect_bound` 5 s: the connect timeout of DP44. The timer stops when the connection opens.
13
+ * Thus it does not change a fault with a call in flight. At its defaults, amqplib has no connect timeout.
14
+ * - `request_timeout` 9.5 s: in the slowest poll of 10 s (O13). After a loss of the leader of a quorum
15
+ * queue, the first confirm came at 6.61 s, 6.68 s and 8.05 s (T11). A later confirm is indeterminate, not lost.
16
+ * - `heartbeat_interval` 15 s: the heartbeat ended a silent connection 45.009 s after the last data,
17
+ * before the kernel gave up at 53.016 s (O17). The frames each 7.5 s keep a flow through a router
18
+ * that forgets it at 30 s (O03). At the 60 s of the broker, the heartbeat came at 180.009 s.
19
+ * - `retry_base` 1 s: the cells connected to the next node 1 s after the end of a connection.
20
+ * - `retry_cap` 8 s: no cell measured it. With its jitter of 1 s, the most delay is 9 s, in the slowest poll of 10 s.
21
+ * - `keepalive_idle` "infinite": amqplib sets no keepalive, and the heartbeat refreshes an idle flow.
22
+ * Linux sends no keepalive probe while data is in flight.
23
+ * - `max_connection_age` "infinite": the client does not replace its connection at an age.
24
+ * - `close_bound` 2 s: behind a black hole, `connection.close` waits for its close-ok with no bound.
25
+ * - `retrans_giveup_time` 924.6 s: the give-up of Linux at `tcp_retries2 = 15`.
26
+ */
27
+ export declare const RABBIT_STARTING_KNOBS: RabbitKnobs;
@@ -0,0 +1,67 @@
1
+ import { STARTING_POLL } from "../client/core.js";
2
+ // src/rabbitmq/starting.ts
3
+ /**
4
+ * This poll is the poll of the checks that `RABBIT_STARTING_KNOBS` fits. It is `STARTING_POLL` of
5
+ * the core: each 5 s with a jitter of 20 %, and a timeout of 4 s (B6, O12). The poll does not depend on the driver.
6
+ */
7
+ const RABBIT_STARTING_POLL = STARTING_POLL;
8
+ /**
9
+ * These knobs are a declaration to start from, from what the cells of R3 measured on amqplib 2.2.0
10
+ * against RabbitMQ 4.3.6. The runtime has no defaults: a service gives these knobs, or its own.
11
+ * Each value holds the borders that the cells measured:
12
+ * - `connect_bound` 5 s: the connect timeout of DP44. The timer stops when the connection opens.
13
+ * Thus it does not change a fault with a call in flight. At its defaults, amqplib has no connect timeout.
14
+ * - `request_timeout` 9.5 s: in the slowest poll of 10 s (O13). After a loss of the leader of a quorum
15
+ * queue, the first confirm came at 6.61 s, 6.68 s and 8.05 s (T11). A later confirm is indeterminate, not lost.
16
+ * - `heartbeat_interval` 15 s: the heartbeat ended a silent connection 45.009 s after the last data,
17
+ * before the kernel gave up at 53.016 s (O17). The frames each 7.5 s keep a flow through a router
18
+ * that forgets it at 30 s (O03). At the 60 s of the broker, the heartbeat came at 180.009 s.
19
+ * - `retry_base` 1 s: the cells connected to the next node 1 s after the end of a connection.
20
+ * - `retry_cap` 8 s: no cell measured it. With its jitter of 1 s, the most delay is 9 s, in the slowest poll of 10 s.
21
+ * - `keepalive_idle` "infinite": amqplib sets no keepalive, and the heartbeat refreshes an idle flow.
22
+ * Linux sends no keepalive probe while data is in flight.
23
+ * - `max_connection_age` "infinite": the client does not replace its connection at an age.
24
+ * - `close_bound` 2 s: behind a black hole, `connection.close` waits for its close-ok with no bound.
25
+ * - `retrans_giveup_time` 924.6 s: the give-up of Linux at `tcp_retries2 = 15`.
26
+ */
27
+ const RABBIT_STARTING_KNOBS = {
28
+ connect_bound: {
29
+ value: 5,
30
+ unit: "s"
31
+ },
32
+ request_timeout: {
33
+ value: 9.5,
34
+ unit: "s"
35
+ },
36
+ heartbeat_interval: {
37
+ value: 15,
38
+ unit: "s"
39
+ },
40
+ retry_base: {
41
+ value: 1,
42
+ unit: "s"
43
+ },
44
+ retry_cap: {
45
+ value: 8,
46
+ unit: "s"
47
+ },
48
+ keepalive_idle: {
49
+ value: "infinite",
50
+ unit: "s"
51
+ },
52
+ max_connection_age: {
53
+ value: "infinite",
54
+ unit: "s"
55
+ },
56
+ close_bound: {
57
+ value: 2,
58
+ unit: "s"
59
+ },
60
+ retrans_giveup_time: {
61
+ value: 924.6,
62
+ unit: "s"
63
+ }
64
+ };
65
+ export { RABBIT_STARTING_KNOBS, RABBIT_STARTING_POLL };
66
+
67
+ //# sourceMappingURL=starting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starting.js","names":[],"sources":["../../src/rabbitmq/starting.ts"],"sourcesContent":["import { STARTING_POLL } from \"../client/core.ts\";\nimport type { Poll } from \"../timing.ts\";\nimport type { RabbitKnobs } from \"./client.ts\";\n\n/**\n * This poll is the poll of the checks that `RABBIT_STARTING_KNOBS` fits. It is `STARTING_POLL` of\n * the core: each 5 s with a jitter of 20 %, and a timeout of 4 s (B6, O12). The poll does not depend on the driver.\n */\nexport const RABBIT_STARTING_POLL: Poll = STARTING_POLL;\n\n/**\n * These knobs are a declaration to start from, from what the cells of R3 measured on amqplib 2.2.0\n * against RabbitMQ 4.3.6. The runtime has no defaults: a service gives these knobs, or its own.\n * Each value holds the borders that the cells measured:\n * - `connect_bound` 5 s: the connect timeout of DP44. The timer stops when the connection opens.\n * Thus it does not change a fault with a call in flight. At its defaults, amqplib has no connect timeout.\n * - `request_timeout` 9.5 s: in the slowest poll of 10 s (O13). After a loss of the leader of a quorum\n * queue, the first confirm came at 6.61 s, 6.68 s and 8.05 s (T11). A later confirm is indeterminate, not lost.\n * - `heartbeat_interval` 15 s: the heartbeat ended a silent connection 45.009 s after the last data,\n * before the kernel gave up at 53.016 s (O17). The frames each 7.5 s keep a flow through a router\n * that forgets it at 30 s (O03). At the 60 s of the broker, the heartbeat came at 180.009 s.\n * - `retry_base` 1 s: the cells connected to the next node 1 s after the end of a connection.\n * - `retry_cap` 8 s: no cell measured it. With its jitter of 1 s, the most delay is 9 s, in the slowest poll of 10 s.\n * - `keepalive_idle` \"infinite\": amqplib sets no keepalive, and the heartbeat refreshes an idle flow.\n * Linux sends no keepalive probe while data is in flight.\n * - `max_connection_age` \"infinite\": the client does not replace its connection at an age.\n * - `close_bound` 2 s: behind a black hole, `connection.close` waits for its close-ok with no bound.\n * - `retrans_giveup_time` 924.6 s: the give-up of Linux at `tcp_retries2 = 15`.\n */\nexport const RABBIT_STARTING_KNOBS: RabbitKnobs = {\n connect_bound: { value: 5, unit: \"s\" },\n request_timeout: { value: 9.5, unit: \"s\" },\n heartbeat_interval: { value: 15, unit: \"s\" },\n retry_base: { value: 1, unit: \"s\" },\n retry_cap: { value: 8, unit: \"s\" },\n keepalive_idle: { value: \"infinite\", unit: \"s\" },\n max_connection_age: { value: \"infinite\", unit: \"s\" },\n close_bound: { value: 2, unit: \"s\" },\n retrans_giveup_time: { value: 924.6, unit: \"s\" },\n};\n"],"mappings":";;;;;;AAQA,MAAa,uBAA6B;;;;;;;;;;;;;;;;;;;;AAqB1C,MAAa,wBAAqC;CAChD,eAAe;EAAE,OAAO;EAAG,MAAM;CAAI;CACrC,iBAAiB;EAAE,OAAO;EAAK,MAAM;CAAI;CACzC,oBAAoB;EAAE,OAAO;EAAI,MAAM;CAAI;CAC3C,YAAY;EAAE,OAAO;EAAG,MAAM;CAAI;CAClC,WAAW;EAAE,OAAO;EAAG,MAAM;CAAI;CACjC,gBAAgB;EAAE,OAAO;EAAY,MAAM;CAAI;CAC/C,oBAAoB;EAAE,OAAO;EAAY,MAAM;CAAI;CACnD,aAAa;EAAE,OAAO;EAAG,MAAM;CAAI;CACnC,qBAAqB;EAAE,OAAO;EAAO,MAAM;CAAI;AACjD"}