Do not update activity on failed requests #292
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.
Up to now, we mark activity for any attempt to talk to an endpoint, by updating the activity timestamp when any request is initiated.
This means that an endpoint that isn't even running anymore (503 errors) will register activity if someone is trying to talk to it.
This moves the activity update to the response
finish
event, which is when the request completes. This lets us take the status code into account, and only consider 'successful' (status < 300) requests to be activity.Consequences:
The last two points mean that there can technically be a delay (usually at most 30 seconds due to various socket timeouts) between when activity is initiated and when it is registered. However, the same change also means that the 'last' activity timeout is also more accurate - more closely aligning with the end of the transaction than the beginning.
This additionally tweaks logging to omit url params, which are not relevant to the proxy.