Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling with inactive sources #312

Open
szyb opened this issue Jul 13, 2022 · 2 comments
Open

Better handling with inactive sources #312

szyb opened this issue Jul 13, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request Priority-high
Milestone

Comments

@szyb
Copy link
Owner

szyb commented Jul 13, 2022

Short description
Sometimes sources not working for a while and then comeback alive. During the downtime, when our cache is expired, each request from WWW and DSM are sent directly to the source server, so it can flood the source server with our requests. This can lead to block website's IP(s) as it acts as potential DDOS attack.

Motivation

  • Avoid request flood the source server when it is down
  • Decrease size of logs
@szyb szyb added the enhancement New feature or request label Jul 13, 2022
@szyb
Copy link
Owner Author

szyb commented Jul 13, 2022

I'm thinking of auto disable feature. It could disable source for a while and check periodically whether enable it or not.

@szyb
Copy link
Owner Author

szyb commented Jul 26, 2022

Now I'm thinking about counting number of failures and decide when to query server one more time.
i.e, (just a sample):
when failureCount < 5 then query the server (no wait)
when >=5 and < 10 then schedule next query to be executed in an hour
when >=10 and < 20 then schedule next query to be executed in 4 hours
when >= 20 and < 30 then schedule next query to be executed in 12 hours
when >= 30 then schedule next query to be executed in 24 hours
In this sample after ~7 days we will send request only once per 24 hours.

Need to also clear number of failures when valid response will be received. FailureCount should be stored per source (no matter what version or model is used) and maybe kept in memory (so the restart will clear the state)

@szyb szyb added this to the v1.1 milestone Jul 26, 2022
@szyb szyb self-assigned this Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Priority-high
Projects
None yet
Development

No branches or pull requests

1 participant