ganache icon indicating copy to clipboard operation
ganache copied to clipboard

fix: implement backoff retry policy for websocket handler

Open satyajeetkolhapure opened this issue 3 years ago • 2 comments
trafficstars

Web socket handler receives closed connection event more frequently than expected from infura server. So to make ganache more robust a backoff retry mechanism is implemented.

Retry configuration - 3 retries with 2 seconds initial retry and with exponential attempts followed.

When connection is closed, in flight requests are stored temporarily and processed once connection retry attempt succeeds.

Note: Once connection is successful, the retry counter is reset to initial counter.

satyajeetkolhapure avatar Sep 01 '22 15:09 satyajeetkolhapure

Would it be possible to get tests added for this change?

MicaiahReid avatar Nov 14 '22 20:11 MicaiahReid

Would it be possible to get tests added for this change? Yes. I am going to add few tests to check InFlightRequests too.

satyajeetkolhapure avatar Nov 15 '22 14:11 satyajeetkolhapure