Make requests to the CHA more resilient #718
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://eaflood.atlassian.net/browse/WATER-4365
As part of looking at re-implementing the SROC annual billing engine in this project, we found a solution that allows us to process bills in parallel (will be added in later commits!) However, the more we do the more strain this puts on the Charging Module API to the point we start seeing timeouts and
ECONNRESET
errors.With just a few tweaks on our side, we could increase our tolerance of these errors. There is still a point where we are pushing it too hard. But the more throughput we get, the faster we can complete the bill run process.
So, this change does the following.
ECONNRESET
errors. We learnt this can happen when an API is under pressure. It doesn't mean the Charging Module can't handle the next attempt so it is safe to try these again.Also a bit of housekeeping. Whilst using the timeout scenarios as the template for updating the network issue ones, we realised that the timeout tests were not checking that a log of the error is recorded after all retries fail.
So, we've gone back and added them in.