Description
When a server node dies, fetchSockets() (and serverSideEmitWithAck()) requests that are
already in-flight will always wait the full requestsTimeout before failing — even if the
dead node is evicted from nodesMap during the wait due to heartbeat timeout.
This happens because expectedResponseCount is computed once at the start of
fetchSockets() via serverCount() and never updated:
|
const expectedResponseCount = (await this.serverCount()) - 1; |
Description
When a server node dies,
fetchSockets()(andserverSideEmitWithAck()) requests that arealready in-flight will always wait the full
requestsTimeoutbefore failing — even if thedead node is evicted from
nodesMapduring the wait due to heartbeat timeout.This happens because
expectedResponseCountis computed once at the start offetchSockets()viaserverCount()and never updated:socket.io-mongo-adapter/lib/index.ts
Line 686 in eff10ab