Checking server reachability
ecm.check_connections() probes every server configured in the pool individually and reports, per server, whether it is reachable, whether login succeeds, and which enaio server information (e.g. product version) it returns.
|
This does not call the server job |
1. Difference from ecm.system.info()
|
Reflects only the currently open pool connections (one per live connection). Says nothing about servers that are configured but not connected to right now. |
|
Actively probes all configured servers from the pool configuration, regardless of whether a connection to them currently exists. The probe connections never enter the pool and do not change the pool statistics. |
2. Connection
from ecmind_blue_client.ecm import ECM
from ecmind_blue_client.pool import SyncPoolClient
# Multiple servers in the pool: hostname:port:weight, separated by '#'
ecm = ECM(SyncPoolClient(
servers="server1:4000:1#server2:4000:1",
username="<user>",
password="<pass>",
))
Async (AsyncPoolClient) works analogously with await before the call.
3. Minimal example
for check in ecm.check_connections():
status = "ok" if check.reachable else f"down ({check.error})"
version = check.server_info.product_version if check.server_info else "?"
print(f"{check.hostname}:{check.port} {status} v={version}")
Async:
for check in await ecm.check_connections():
...
4. Return value: ECMServerConnectionCheck
check_connections() returns a list of ECMServerConnectionCheck — one entry per configured server, in configuration order. An unreachable server does not abort the others; failures are recorded in the error field instead of being raised.
| Field | Type | Meaning |
|---|---|---|
|
|
Hostname that was probed. |
|
|
TCP port that was probed. |
|
|
|
|
|
|
|
|
Server information (product version, platform, …) if |
|
|
|
5. Semantics of the result fields
| Scenario | reachable |
authenticated |
server_info |
error |
|---|---|---|---|---|
Server down / refused / DNS failure / TCP timeout |
|
|
|
|
TLS handshake fails |
|
|
|
|
TCP+TLS ok, bad credentials |
|
|
|
|
Login ok, |
|
|
|
|
Full success |
|
|
|
|
In short: reachable = transport (TCP+TLS) established; authenticated = enaio login succeeded; server_info present = GetServerInfoEx returned data.
|
The session-setup jobs use no read timeout — the same as the regular pool. A server that accepts the TCP connection but then hangs during login blocks the probe for that server. Only the initial connect is bounded by |
6. Related topics
-
info() for statistics on the currently open pool connections