@clickhouse/client 1.18.2 → 1.18.3-head.32a2343.1

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.
@@ -0,0 +1,623 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SocketPool = void 0;
7
+ const stream_1 = __importDefault(require("stream"));
8
+ const zlib_1 = __importDefault(require("zlib"));
9
+ const client_common_1 = require("@clickhouse/client-common");
10
+ const utils_1 = require("../utils");
11
+ const compression_1 = require("./compression");
12
+ class SocketPool {
13
+ connectionId;
14
+ params;
15
+ createClientRequest;
16
+ agent;
17
+ jsonHandling;
18
+ knownSockets = new WeakMap();
19
+ // For overflow concerns:
20
+ // node -e 'console.log(Number.MAX_SAFE_INTEGER / (1_000_000 * 60 * 60 * 24 * 366))'
21
+ // gives 284 years of continuous operation at 1M requests per second
22
+ // before overflowing the 53-bit integer
23
+ requestCounter = 0;
24
+ getNewRequestId() {
25
+ this.requestCounter += 1;
26
+ return `${this.connectionId}:${this.requestCounter}`;
27
+ }
28
+ socketCounter = 0;
29
+ getNewSocketId() {
30
+ this.socketCounter += 1;
31
+ return `${this.connectionId}:${this.socketCounter}`;
32
+ }
33
+ constructor(connectionId, params, createClientRequest, agent) {
34
+ this.connectionId = connectionId;
35
+ this.params = params;
36
+ this.createClientRequest = createClientRequest;
37
+ this.agent = agent;
38
+ this.jsonHandling = params.json ?? {
39
+ parse: JSON.parse,
40
+ stringify: JSON.stringify,
41
+ };
42
+ }
43
+ async request(params, op) {
44
+ // allows the event loop to process the idle socket timers, if the CPU load is high
45
+ // otherwise, we can occasionally get an expired socket, see https://github.com/ClickHouse/clickhouse-js/issues/294
46
+ await (0, client_common_1.sleep)(0);
47
+ const { log_writer, query_id, log_level } = params;
48
+ const currentStackTrace = this.params.capture_enhanced_stack_trace
49
+ ? (0, client_common_1.getCurrentStackTrace)()
50
+ : undefined;
51
+ const requestTimeout = this.params.request_timeout;
52
+ if (this.params.eagerly_destroy_stale_sockets &&
53
+ this.params.keep_alive.enabled &&
54
+ this.params.keep_alive.idle_socket_ttl > 0) {
55
+ // Just checking in case of a custom agent with a different implementation
56
+ if (this.agent.freeSockets) {
57
+ for (const host of Object.keys(this.agent.freeSockets)) {
58
+ const byHostSockets = this.agent.freeSockets[host];
59
+ if (byHostSockets) {
60
+ for (const socket of [...byHostSockets]) {
61
+ const socketInfo = this.knownSockets.get(socket);
62
+ if (socketInfo) {
63
+ const freedAt = socketInfo.freed_at_timestamp_ms;
64
+ if (freedAt) {
65
+ const socketAge = Date.now() - freedAt;
66
+ // The check below is still racy on a CPU starved machine.
67
+ // A throttled machine can check time on one line, then get descheduled,
68
+ // decide the socket is still good after rescheduling, and then proceed
69
+ // to use a socket that has actually been idle for much longer than `idle_socket_ttl`.
70
+ // However, this is an edge case that should be clearly visible in the
71
+ // application monitoring.
72
+ if (socketAge >= this.params.keep_alive.idle_socket_ttl) {
73
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
74
+ log_writer.trace({
75
+ message: `${op}: socket TTL expired based on timestamp, destroying socket`,
76
+ args: {
77
+ operation: op,
78
+ connection_id: this.connectionId,
79
+ query_id,
80
+ socket_id: socketInfo.id,
81
+ socket_age_ms: socketAge,
82
+ idle_socket_ttl_ms: this.params.keep_alive.idle_socket_ttl,
83
+ },
84
+ });
85
+ }
86
+ clearTimeout(socketInfo.idle_timeout_handle);
87
+ this.knownSockets.delete(socket);
88
+ socket.destroy();
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ const start = Date.now();
98
+ const request = this.createClientRequest(params);
99
+ const request_id = this.getNewRequestId();
100
+ return new Promise((resolve, reject) => {
101
+ const onError = (e) => {
102
+ removeRequestListeners();
103
+ if (e instanceof Error) {
104
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
105
+ if (e.code === 'ECONNRESET') {
106
+ log_writer.trace({
107
+ message: `${op}: connection reset by peer`,
108
+ args: {
109
+ operation: op,
110
+ connection_id: this.connectionId,
111
+ query_id,
112
+ request_id,
113
+ },
114
+ module: 'HTTP Adapter',
115
+ });
116
+ }
117
+ }
118
+ if (log_level <= client_common_1.ClickHouseLogLevel.WARN) {
119
+ if (this.params.keep_alive.enabled) {
120
+ if (e.code === 'ECONNRESET') {
121
+ const socket = request.socket;
122
+ if (socket) {
123
+ const socketInfo = this.knownSockets.get(socket);
124
+ if (socketInfo) {
125
+ const serverTimeoutMs = socketInfo.server_keep_alive_timeout_ms;
126
+ if (serverTimeoutMs !== undefined) {
127
+ if (this.params.keep_alive.idle_socket_ttl > serverTimeoutMs) {
128
+ log_writer.warn({
129
+ message: `${op}: idle socket TTL is greater than server keep-alive timeout, try setting idle socket TTL to a value lower than the server keep-alive timeout to prevent unexpected connection resets, see https://c.house/js_keep_alive_econnreset for more details.`,
130
+ args: {
131
+ operation: op,
132
+ connection_id: this.connectionId,
133
+ query_id,
134
+ request_id,
135
+ socket_id: socketInfo.id,
136
+ server_keep_alive_timeout_ms: serverTimeoutMs,
137
+ idle_socket_ttl: this.params.keep_alive.idle_socket_ttl,
138
+ },
139
+ module: 'HTTP Adapter',
140
+ });
141
+ }
142
+ }
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ const err = (0, client_common_1.enhanceStackTrace)(e, currentStackTrace);
149
+ reject(err);
150
+ }
151
+ else {
152
+ reject(e);
153
+ }
154
+ };
155
+ let responseStream;
156
+ const onResponse = async (_response) => {
157
+ if (this.params.log_level <= client_common_1.ClickHouseLogLevel.DEBUG) {
158
+ const duration = Date.now() - start;
159
+ this.params.log_writer.debug({
160
+ module: 'HTTP Adapter',
161
+ message: `${op}: got a response from ClickHouse`,
162
+ args: {
163
+ operation: op,
164
+ connection_id: this.connectionId,
165
+ query_id,
166
+ request_id,
167
+ request_method: params.method,
168
+ request_path: params.url.pathname,
169
+ response_status: _response.statusCode,
170
+ response_time_ms: duration,
171
+ },
172
+ });
173
+ }
174
+ if (this.params.keep_alive.enabled) {
175
+ const keepAliveHeader = _response.headers['keep-alive'];
176
+ if (keepAliveHeader) {
177
+ const [, timeout] = /timeout=(\d+)/i.exec(String(keepAliveHeader)) ?? [];
178
+ if (timeout) {
179
+ const socketInfo = this.knownSockets.get(_response.socket);
180
+ if (socketInfo) {
181
+ const timeoutMs = Number(timeout) * 1000;
182
+ socketInfo.server_keep_alive_timeout_ms = timeoutMs;
183
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
184
+ this.params.log_writer.trace({
185
+ module: 'HTTP Adapter',
186
+ message: `${op}: updated server sent socket keep-alive timeout`,
187
+ args: {
188
+ operation: op,
189
+ connection_id: this.connectionId,
190
+ query_id,
191
+ request_id,
192
+ socket_id: socketInfo.id,
193
+ server_keep_alive_timeout_ms: timeoutMs,
194
+ },
195
+ });
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ const tryDecompressResponseStream = params.try_decompress_response_stream ?? true;
202
+ const ignoreErrorResponse = params.ignore_error_response ?? false;
203
+ // even if the stream decompression is disabled, we have to decompress it in case of an error
204
+ const isFailedResponse = !(0, client_common_1.isSuccessfulResponse)(_response.statusCode);
205
+ if (tryDecompressResponseStream ||
206
+ (isFailedResponse && !ignoreErrorResponse)) {
207
+ const decompressionResult = (0, compression_1.decompressResponse)(_response, log_writer, log_level);
208
+ if ((0, compression_1.isDecompressionError)(decompressionResult)) {
209
+ const err = (0, client_common_1.enhanceStackTrace)(decompressionResult.error, currentStackTrace);
210
+ return reject(err);
211
+ }
212
+ responseStream = decompressionResult.response;
213
+ }
214
+ else {
215
+ responseStream = _response;
216
+ }
217
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
218
+ log_writer.trace({
219
+ message: `${op}: response stream created`,
220
+ args: {
221
+ operation: op,
222
+ connection_id: this.connectionId,
223
+ query_id,
224
+ request_id,
225
+ stream_state: {
226
+ readable: responseStream.readable,
227
+ readableEnded: responseStream.readableEnded,
228
+ readableLength: responseStream.readableLength,
229
+ },
230
+ is_failed_response: isFailedResponse,
231
+ will_decompress: tryDecompressResponseStream,
232
+ },
233
+ });
234
+ }
235
+ if (isFailedResponse && !ignoreErrorResponse) {
236
+ try {
237
+ const errorMessage = await (0, utils_1.getAsText)(responseStream);
238
+ const err = (0, client_common_1.enhanceStackTrace)((0, client_common_1.parseError)(errorMessage), currentStackTrace);
239
+ reject(err);
240
+ }
241
+ catch (e) {
242
+ // If the ClickHouse response is malformed
243
+ const err = (0, client_common_1.enhanceStackTrace)(e, currentStackTrace);
244
+ reject(err);
245
+ }
246
+ }
247
+ else {
248
+ return resolve({
249
+ stream: responseStream,
250
+ summary: params.parse_summary
251
+ ? this.parseSummary(op, _response)
252
+ : undefined,
253
+ response_headers: { ..._response.headers },
254
+ http_status_code: _response.statusCode ?? undefined,
255
+ });
256
+ }
257
+ };
258
+ function onAbort() {
259
+ // Prefer 'abort' event since it always triggered unlike 'error' and 'close'
260
+ // see the full sequence of events https://nodejs.org/api/http.html#httprequesturl-options-callback
261
+ removeRequestListeners();
262
+ request.once('error', function () {
263
+ /**
264
+ * catch "Error: ECONNRESET" error which shouldn't be reported to users.
265
+ * see the full sequence of events https://nodejs.org/api/http.html#httprequesturl-options-callback
266
+ * */
267
+ });
268
+ const err = (0, client_common_1.enhanceStackTrace)(new Error('The user aborted a request.'), currentStackTrace);
269
+ reject(err);
270
+ }
271
+ function onClose() {
272
+ // Adapter uses 'close' event to clean up listeners after the successful response.
273
+ // It's necessary in order to handle 'abort' and 'timeout' events while response is streamed.
274
+ // It's always the last event, according to https://nodejs.org/docs/latest-v14.x/api/http.html#http_http_request_url_options_callback
275
+ removeRequestListeners();
276
+ }
277
+ function pipeStream() {
278
+ // if request.end() was called due to no data to send
279
+ if (request.writableEnded) {
280
+ return;
281
+ }
282
+ const bodyStream = (0, utils_1.isStream)(params.body)
283
+ ? params.body
284
+ : stream_1.default.Readable.from([params.body]);
285
+ const callback = (e) => {
286
+ if (e) {
287
+ removeRequestListeners();
288
+ const err = (0, client_common_1.enhanceStackTrace)(e, currentStackTrace);
289
+ reject(err);
290
+ }
291
+ };
292
+ if (params.enable_request_compression) {
293
+ stream_1.default.pipeline(bodyStream, zlib_1.default.createGzip(), request, callback);
294
+ }
295
+ else {
296
+ stream_1.default.pipeline(bodyStream, request, callback);
297
+ }
298
+ }
299
+ const onSocket = (socket) => {
300
+ try {
301
+ if (this.params.keep_alive.enabled &&
302
+ this.params.keep_alive.idle_socket_ttl > 0) {
303
+ const socketInfo = this.knownSockets.get(socket);
304
+ // It is the first time we've encountered this socket,
305
+ // so it doesn't have the idle timeout handler attached to it
306
+ if (socketInfo === undefined) {
307
+ const socket_id = this.getNewSocketId();
308
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
309
+ log_writer.trace({
310
+ message: `${op}: using a fresh socket, setting up a new 'free' listener`,
311
+ args: {
312
+ operation: op,
313
+ connection_id: this.connectionId,
314
+ query_id,
315
+ request_id,
316
+ socket_id,
317
+ },
318
+ });
319
+ }
320
+ const newSocketInfo = {
321
+ id: socket_id,
322
+ idle_timeout_handle: undefined,
323
+ usage_count: 1,
324
+ };
325
+ this.knownSockets.set(socket, newSocketInfo);
326
+ // When the request is complete and the socket is released,
327
+ // make sure that the socket is removed after `idle_socket_ttl`.
328
+ socket.on('free', () => {
329
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
330
+ log_writer.trace({
331
+ message: `${op}: socket was released`,
332
+ args: {
333
+ operation: op,
334
+ connection_id: this.connectionId,
335
+ query_id,
336
+ request_id,
337
+ socket_id,
338
+ },
339
+ });
340
+ }
341
+ const freed_at_timestamp_ms = Date.now();
342
+ newSocketInfo.freed_at_timestamp_ms = freed_at_timestamp_ms;
343
+ // Avoiding the built-in socket.timeout() method usage here,
344
+ // as we don't want to clash with the actual request timeout.
345
+ const idleTimeoutHandle = setTimeout(() => {
346
+ const freedAfter = Date.now() - freed_at_timestamp_ms;
347
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
348
+ log_writer.trace({
349
+ message: `${op}: removing idle socket`,
350
+ args: {
351
+ operation: op,
352
+ connection_id: this.connectionId,
353
+ query_id,
354
+ request_id,
355
+ socket_id,
356
+ idle_socket_ttl_ms: this.params.keep_alive.idle_socket_ttl,
357
+ freed_after_ms: freedAfter,
358
+ },
359
+ });
360
+ }
361
+ this.knownSockets.delete(socket);
362
+ socket.destroy();
363
+ }, this.params.keep_alive.idle_socket_ttl).unref();
364
+ newSocketInfo.idle_timeout_handle = idleTimeoutHandle;
365
+ });
366
+ const cleanup = (eventName) => () => {
367
+ const maybeSocketInfo = this.knownSockets.get(socket);
368
+ // clean up a possibly dangling idle timeout handle (preventing leaks)
369
+ if (maybeSocketInfo?.idle_timeout_handle) {
370
+ clearTimeout(maybeSocketInfo.idle_timeout_handle);
371
+ }
372
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
373
+ log_writer.trace({
374
+ message: `${op}: received '${eventName}' event, 'free' listener removed`,
375
+ args: {
376
+ operation: op,
377
+ connection_id: this.connectionId,
378
+ query_id,
379
+ request_id,
380
+ socket_id,
381
+ event: eventName,
382
+ },
383
+ });
384
+ }
385
+ if (log_level <= client_common_1.ClickHouseLogLevel.WARN) {
386
+ if (responseStream && !responseStream.readableEnded) {
387
+ log_writer.warn({
388
+ message: `${op}: socket was closed or ended before the response was fully read. ` +
389
+ 'This can potentially result in an uncaught ECONNRESET error! ' +
390
+ 'Consider fully consuming, draining, or destroying the response stream.',
391
+ args: {
392
+ operation: op,
393
+ connection_id: this.connectionId,
394
+ query_id,
395
+ request_id,
396
+ socket_id,
397
+ event: eventName,
398
+ },
399
+ });
400
+ }
401
+ }
402
+ };
403
+ socket.once('end', cleanup('end'));
404
+ socket.once('close', cleanup('close'));
405
+ }
406
+ else {
407
+ const freedAt = socketInfo.freed_at_timestamp_ms;
408
+ if (freedAt) {
409
+ // On a CPU throttled machine or when event loop is delayed,
410
+ // the socket can be idle for much longer than `idle_socket_ttl`
411
+ // as the timers don't fire exactly on time which can lead
412
+ // to a stale socket being reused.
413
+ const socketAge = Date.now() - freedAt;
414
+ const overdueBy = socketAge - this.params.keep_alive.idle_socket_ttl;
415
+ // Give some grace period to account for timer inaccuracy and minor
416
+ // event loop delays, but log if the socket is significantly overdue
417
+ if (overdueBy > 1000) {
418
+ if (log_level <= client_common_1.ClickHouseLogLevel.WARN) {
419
+ log_writer.warn({
420
+ message: `${op}: reusing socket with TTL expired based on timestamp; this may indicate a starved Node.js process or delayed event loop; set keep_alive.eagerly_destroy_stale_sockets=true to mitigate`,
421
+ args: {
422
+ operation: op,
423
+ connection_id: this.connectionId,
424
+ query_id,
425
+ socket_id: socketInfo.id,
426
+ socket_age_ms: socketAge,
427
+ idle_socket_ttl_ms: this.params.keep_alive.idle_socket_ttl,
428
+ },
429
+ });
430
+ }
431
+ }
432
+ }
433
+ clearTimeout(socketInfo.idle_timeout_handle);
434
+ socketInfo.idle_timeout_handle = undefined;
435
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
436
+ log_writer.trace({
437
+ message: `${op}: reusing socket`,
438
+ args: {
439
+ operation: op,
440
+ connection_id: this.connectionId,
441
+ query_id,
442
+ request_id,
443
+ socket_id: socketInfo.id,
444
+ usage_count: socketInfo.usage_count,
445
+ },
446
+ });
447
+ }
448
+ socketInfo.usage_count++;
449
+ }
450
+ }
451
+ }
452
+ catch (e) {
453
+ if (log_level <= client_common_1.ClickHouseLogLevel.ERROR) {
454
+ log_writer.error({
455
+ message: `${op}: an error occurred while housekeeping the idle sockets`,
456
+ err: e,
457
+ args: {
458
+ operation: op,
459
+ connection_id: this.connectionId,
460
+ query_id,
461
+ request_id,
462
+ },
463
+ });
464
+ }
465
+ }
466
+ // Socket is "prepared" with idle handlers, continue with our request
467
+ pipeStream();
468
+ // This is for request timeout only. Surprisingly, it is not always enough to set in the HTTP request.
469
+ // The socket won't be destroyed, and it will be returned to the pool.
470
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
471
+ const socketInfo = this.knownSockets.get(socket);
472
+ if (socketInfo) {
473
+ log_writer.trace({
474
+ message: `${op}: setting up request timeout`,
475
+ args: {
476
+ operation: op,
477
+ connection_id: this.connectionId,
478
+ query_id,
479
+ request_id,
480
+ socket_id: socketInfo.id,
481
+ timeout_ms: requestTimeout,
482
+ },
483
+ });
484
+ }
485
+ else {
486
+ log_writer.trace({
487
+ message: `${op}: setting up request timeout on a socket`,
488
+ args: {
489
+ operation: op,
490
+ connection_id: this.connectionId,
491
+ query_id,
492
+ request_id,
493
+ timeout_ms: requestTimeout,
494
+ },
495
+ });
496
+ }
497
+ }
498
+ socket.setTimeout(this.params.request_timeout, onTimeout);
499
+ };
500
+ const onTimeout = () => {
501
+ removeRequestListeners();
502
+ if (log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
503
+ const socket = request.socket;
504
+ const maybeSocketInfo = socket
505
+ ? this.knownSockets.get(socket)
506
+ : undefined;
507
+ const socketState = request.socket
508
+ ? {
509
+ connecting: request.socket.connecting,
510
+ pending: request.socket.pending,
511
+ destroyed: request.socket.destroyed,
512
+ readyState: request.socket.readyState,
513
+ }
514
+ : undefined;
515
+ const responseStreamState = responseStream
516
+ ? {
517
+ readable: responseStream.readable,
518
+ readableEnded: responseStream.readableEnded,
519
+ readableLength: responseStream.readableLength,
520
+ }
521
+ : undefined;
522
+ log_writer.trace({
523
+ message: `${op}: timeout occurred`,
524
+ args: {
525
+ operation: op,
526
+ connection_id: this.connectionId,
527
+ query_id,
528
+ request_id,
529
+ socket_id: maybeSocketInfo?.id,
530
+ timeout_ms: requestTimeout,
531
+ socket_state: socketState,
532
+ response_stream_state: responseStreamState,
533
+ has_response_stream: responseStream !== undefined,
534
+ },
535
+ });
536
+ }
537
+ const err = (0, client_common_1.enhanceStackTrace)(new Error('Timeout error.'), currentStackTrace);
538
+ try {
539
+ request.destroy();
540
+ }
541
+ catch (e) {
542
+ if (log_level <= client_common_1.ClickHouseLogLevel.ERROR) {
543
+ log_writer.error({
544
+ message: `${op}: An error occurred while destroying the request`,
545
+ err: e,
546
+ args: {
547
+ operation: op,
548
+ connection_id: this.connectionId,
549
+ query_id,
550
+ request_id,
551
+ },
552
+ });
553
+ }
554
+ }
555
+ reject(err);
556
+ };
557
+ function removeRequestListeners() {
558
+ if (request.socket) {
559
+ request.socket.setTimeout(0); // reset previously set timeout
560
+ request.socket.removeListener('timeout', onTimeout);
561
+ }
562
+ request.removeListener('socket', onSocket);
563
+ request.removeListener('response', onResponse);
564
+ request.removeListener('error', onError);
565
+ request.removeListener('close', onClose);
566
+ if (params.abort_signal) {
567
+ request.removeListener('abort', onAbort);
568
+ }
569
+ }
570
+ request.on('socket', onSocket);
571
+ request.on('response', onResponse);
572
+ request.on('error', onError);
573
+ request.on('close', onClose);
574
+ if (params.abort_signal) {
575
+ params.abort_signal.addEventListener('abort', onAbort, {
576
+ once: true,
577
+ });
578
+ }
579
+ if (!params.body) {
580
+ try {
581
+ return request.end();
582
+ }
583
+ catch (e) {
584
+ if (log_level <= client_common_1.ClickHouseLogLevel.ERROR) {
585
+ log_writer.error({
586
+ message: `${op}: an error occurred while ending the request without body`,
587
+ err: e,
588
+ args: {
589
+ operation: op,
590
+ connection_id: this.connectionId,
591
+ query_id,
592
+ request_id,
593
+ },
594
+ });
595
+ }
596
+ }
597
+ }
598
+ });
599
+ }
600
+ parseSummary(op, response) {
601
+ const summaryHeader = response.headers['x-clickhouse-summary'];
602
+ if (typeof summaryHeader === 'string') {
603
+ try {
604
+ return this.jsonHandling.parse(summaryHeader);
605
+ }
606
+ catch (err) {
607
+ if (this.params.log_level <= client_common_1.ClickHouseLogLevel.ERROR) {
608
+ this.params.log_writer.error({
609
+ message: `${op}: failed to parse X-ClickHouse-Summary header.`,
610
+ args: {
611
+ operation: op,
612
+ connection_id: this.connectionId,
613
+ 'X-ClickHouse-Summary': summaryHeader,
614
+ },
615
+ err: err,
616
+ });
617
+ }
618
+ }
619
+ }
620
+ }
621
+ }
622
+ exports.SocketPool = SocketPool;
623
+ //# sourceMappingURL=socket_pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socket_pool.js","sourceRoot":"","sources":["../../src/connection/socket_pool.ts"],"names":[],"mappings":";;;;;;AACA,oDAA2B;AAE3B,gDAAuB;AACvB,6DAYkC;AAClC,oCAA8C;AAC9C,+CAAwE;AAwCxE,MAAa,UAAU;IAqBF;IACA;IACA;IACA;IAvBF,YAAY,CAAc;IAC1B,YAAY,GAAG,IAAI,OAAO,EAA0B,CAAA;IAErE,yBAAyB;IACzB,sFAAsF;IACtF,oEAAoE;IACpE,wCAAwC;IAChC,cAAc,GAAG,CAAC,CAAA;IAClB,eAAe;QACrB,IAAI,CAAC,cAAc,IAAI,CAAC,CAAA;QACxB,OAAO,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,cAAc,EAAE,CAAA;IACtD,CAAC;IAEO,aAAa,GAAG,CAAC,CAAA;IACjB,cAAc;QACpB,IAAI,CAAC,aAAa,IAAI,CAAC,CAAA;QACvB,OAAO,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,aAAa,EAAE,CAAA;IACrD,CAAC;IAED,YACmB,YAAoB,EACpB,MAA4B,EAC5B,mBAAwC,EACxC,KAAiB;QAHjB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,WAAM,GAAN,MAAM,CAAsB;QAC5B,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,UAAK,GAAL,KAAK,CAAY;QAElC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,IAAI,IAAI;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACH,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,EAAiB;QAEjB,mFAAmF;QACnF,mHAAmH;QACnH,MAAM,IAAA,qBAAK,EAAC,CAAC,CA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