sipb / spike

Implementing a packet level software network load balancer
MIT License
11 stars 10 forks source link

Make health check fail on timeout or http error #30

Closed rusch95 closed 7 years ago

rusch95 commented 7 years ago

Added a timeout for the http.Get. I also added a check for if there is an error, which might be unnecessary, so remove at your call.

Testing:

Set timeout to 1 nanoseconds; servers all report failed correctly. Set timeout to 3 seconds, all servers healthy.

rusch95 commented 7 years ago

Should I use the timeout passed into Check?

cryslith commented 7 years ago

No, that is a different timeout (length of time without receiving any good replies until we declare the backend to be down).  Probably, we should rename them to be less ambiguous.