Commit c04b1a3
committed
Probe OvnClient component liveness via control socket
GetProcessInfo used to read the daemon PID from a .pid file and stat
/proc/<pid> to derive its user/group. That only works when the daemon
runs in the host PID namespace. In containerized deployments (Kolla,
and anywhere else the component runs under a separate PID namespace)
the PID file contains the container-namespace PID, so reading
/proc/<pid> on the host either returns wrong data (unrelated host
process at that numeric ID) or fails outright (no such process).
Replace the filesystem dance with a control-socket probe using the
same JSON-RPC unix socket the exporter already reaches over
(ovnnb_db.ctl, ovnsb_db.ctl, ovn-northd.ctl). A successful "version"
command means the daemon is alive; no PID or process metadata is
needed. The function now returns a zero-value OvsProcess on success
since the numeric PID and host user/group are meaningless in a
container; callers should treat a nil error as "reachable".
Drop the *-monitoring variants and ovs-vswitchd/ovsdb-server cases;
they existed only to walk the parent/daemon tree via /proc, which
this approach doesn't support.
OvsClient.GetProcessInfo is unchanged since ovs_exporter still needs
the /proc-based lookup on hosts that run OVS natively.1 parent d033504 commit c04b1a3
1 file changed
Lines changed: 12 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
108 | 112 | | |
109 | | - | |
110 | | - | |
| 113 | + | |
111 | 114 | | |
112 | | - | |
113 | | - | |
114 | 115 | | |
115 | | - | |
116 | | - | |
117 | | - | |
| 116 | + | |
118 | 117 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 118 | + | |
122 | 119 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 120 | + | |
128 | 121 | | |
129 | 122 | | |
130 | 123 | | |
131 | | - | |
132 | | - | |
| 124 | + | |
| 125 | + | |
133 | 126 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 127 | + | |
153 | 128 | | |
154 | 129 | | |
155 | 130 | | |
| |||
0 commit comments