A handler for data is added along with a line of code that sets the retry counter to 0 when data is received. This ensures that the max retries limit is only reached if enough consecutive retriable errors are encountered without any data being received between those errors. This is being introduced to match current nodejs-bigtable retry behaviour where a counter is reset that interacts with the maxRetries parameters for custom retries.
Test changes
A test is added that emits 4 retryable errors from a server while also emitting data between each error. Since max retries is set in this test to 2 then the test ensures that the retry count is actually being reset because the test only passes if none of the retriable errors result in the max retries limit being reached.
Source code changes
A handler for data is added along with a line of code that sets the retry counter to 0 when data is received. This ensures that the max retries limit is only reached if enough consecutive retriable errors are encountered without any data being received between those errors. This is being introduced to match current nodejs-bigtable retry behaviour where a counter is reset that interacts with the
maxRetries
parameters for custom retries.Test changes
A test is added that emits 4 retryable errors from a server while also emitting data between each error. Since max retries is set in this test to 2 then the test ensures that the retry count is actually being reset because the test only passes if none of the retriable errors result in the max retries limit being reached.