-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add the ability to send requests with "safe" checking, exiting early if the service info cannot be quickly communicated with #63
Conversation
…if the service info cannot be quickly communicated with
I cannot get any change I make to live_servers to make a difference in the responses I get from federation. I deleted the
|
@daisieh Did you include the "safe" flag in your request? The code is only active if it is explicitly asked to be safe -- though thinking about it perhaps that's the wrong behaviour. |
Ah yes, that seems to be the problem. But if live_servers.txt contains live_servers.txt:
|
Indeed, it should. I'm not sure what could cause that error -- was there any whitespace in live_servers.txt? |
Not that I can tell. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, after fixing a few things, I think it works correctly on my system. You might want to confirm my changes before merging.
Yup, those changes work for me ✔️ |
Jira ticket
DIG-1708
Description
This PR introduces the ability to send requests with the "safe" header before a fanout call, which checks which servers are currently communicable. This was prompted by the BC server taking a long time to serve any request while the UHN server was experiencing DNS issues.
The idea here is to shortcut away requests (before the usual 60s timeout) if a server is unable to serve a service-info request. This involves a heartbeat script that is constantly checking the uptime of connected servers, and a "safe" header that can be used in all frontend requests. If a server is detected to be down by the heartbeat script, all safe requests will subsequently ignore that server.
To test
/app/federation/live_servers.txt
, and requests to fanout/app/federation/live_servers.txt
./app/federation/live_servers.txt
You should get a response like the following: