Currently, we instantiate a new Backoff and BackoffStrategy every time reconnect is called via backoff.fibonacci which is equivalent to new Backoff(new FibonacciBackoffStrategy(options)).
This is problematic because when the socket is closed (for instance when we get a ECONNREFUSED) the backoff strategy is instantiated again and, as a result, the backoff value will be the initial value (defeating the purpose of using an incremental backoff).
Currently, we instantiate a new
Backoff
andBackoffStrategy
every timereconnect
is called viabackoff.fibonacci
which is equivalent tonew Backoff(new FibonacciBackoffStrategy(options))
.https://github.com/pinojs/pino-socket/blob/4d79b0e1f201db0ae72347c68be0cdfdafad4346/lib/TcpConnection.js#L95
This is problematic because when the socket is closed (for instance when we get a
ECONNREFUSED
) the backoff strategy is instantiated again and, as a result, the backoff value will be the initial value (defeating the purpose of using an incremental backoff).