nydus icon indicating copy to clipboard operation
nydus copied to clipboard

feat: skip proxy health check if connection is not active

Open BruceAko opened this issue 1 year ago • 0 comments

Relevant Issue (if applicable)

Fixes #1588

Details

  1. Add last_active field for Connection. When Connection.call() is called, last_active is updated to current time.
  2. Add max_elapsed_time field for ProxyConfig. Connection is considered to be inactive if the current time to the last_active time exceeds max_elapsed_time.
  3. 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.

BruceAko avatar Jul 03 '24 06:07 BruceAko