An operations team runs a legacy application that cannot expose an HTTP endpoint but does listen on TCP port 5432. They define a TCP health check in the service registration. During an incident, the port remains open but the application process is hung and no longer accepts new connections. What will Consul report for this check?
Trap 1: warning, because the TCP handshake is slow
The scenario does not state that the handshake is slow, only that the application is hung after the port is open. Warning status is not automatically assigned based on latency. Consul's TCP check either succeeds or fails; it does not produce a warning purely because the application behind the port is unresponsive.
Trap 2: critical, because the application is hung
Consul's TCP check has no application-level awareness. It does not send data or inspect the application's state; it only verifies that a TCP connection can be established. A hung process that still holds the listening socket open will not cause a critical result, so this answer misstates how the check works.
Trap 3: maintenance, because the process is not accepting connections
Maintenance mode is an operator-controlled state, not an automatic result of application behavior. Consul does not place a check into maintenance because a process is hung. The TCP check will still evaluate the socket and report passing if the port accepts a connection, so maintenance is not applicable here.
- A
warning, because the TCP handshake is slow
Why it fails: The scenario does not state that the handshake is slow, only that the application is hung after the port is open. Warning status is not automatically assigned based on latency. Consul's TCP check either succeeds or fails; it does not produce a warning purely because the application behind the port is unresponsive.
- B
critical, because the application is hung
Why it fails: Consul's TCP check has no application-level awareness. It does not send data or inspect the application's state; it only verifies that a TCP connection can be established. A hung process that still holds the listening socket open will not cause a critical result, so this answer misstates how the check works.
- C
maintenance, because the process is not accepting connections
Why it fails: Maintenance mode is an operator-controlled state, not an automatic result of application behavior. Consul does not place a check into maintenance because a process is hung. The TCP check will still evaluate the socket and report passing if the port accepts a connection, so maintenance is not applicable here.
- D
passing, because the TCP port is open
A TCP check only attempts to open a connection to the configured host and port. If the TCP handshake succeeds, the check is passing regardless of whether the application accepts or processes data on that connection. In this scenario the port is still open, so Consul reports passing even though the process is hung.