ClickHouse / clickhouse-js

Official JS client for ClickHouse DB
https://clickhouse.com
Apache License 2.0
205 stars 25 forks source link

Improve sockets housekeeping mechanism #237

Closed slvrtrn closed 5 months ago

slvrtrn commented 6 months ago

Currently, implemented in a branch: https://github.com/ClickHouse/clickhouse-js/compare/main...idle-sockets-timeouts

It needs a rebase to 1.0.0.

General idea: instead of tracking if a socket could be expired while idling and deciding what to do with it when making an HTTP request, just terminate it after (by default) 2500 ms using Node.js Socket.on('free') API.