nydus
nydus copied to clipboard
feat: skip proxy health check if connection is not active
Relevant Issue (if applicable)
Fixes #1588
Details
- Add
last_activefield forConnection. WhenConnection.call()is called,last_activeis updated to current time. - Add
max_elapsed_timefield forProxyConfig. Connection is considered to be inactive if the current time to thelast_activetime exceedsmax_elapsed_time. - In proxy's health checking thread's loop, if the connection is not active (exceeds
max_elapsed_time), this round of health check is skipped.
Types of changes
What types of changes does your PullRequest introduce? Put an x in all the boxes that apply:
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation Update (if none of the other choices apply)
Checklist
Go over all the following points, and put an x in all the boxes that apply.
- [x] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.