It is learned that Heartbeat employs Golang context to manage the session to do the http check, Getting “context deadline exceeds” error message while accessing a target timeout.
However, there’re 2 different cases would cause timeout:
- The target host is unpingable, for example:
ping -q -c 1 <faked host> PING <faked host> (<faked host>) 56(84) bytes of data. --- <faked host> ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms $ time telnet <faked host> Trying <faked host>... telnet: Unable to connect to remote host: Connection timed out real 2m9.623s
- The port that the specific service is listening but response is very slow.
Wondering if there’s a way to distinguish these 2 kinds of cases?