You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/gnoi-native-grpc-design.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,23 +2,23 @@
2
2
3
3
## TL;DR
4
4
5
-
`gnoi_shutdown_daemon` issues gNOI RPCs by shelling out to `docker exec gnmi gnoi_client`. This is fragile, opaque, and already causing silent failures. Replace with direct Python gRPC calls using vendored proto stubs.
5
+
`gnoi_shutdown_daemon` issues gNOI RPCs by shelling out to `docker exec gnmi gnoi_client`. This introduces several layers of indirection that make failures hard to diagnose and completion detection unreliable. This document proposes replacing the subprocess path with direct Python gRPC calls using vendored proto stubs.
6
6
7
-
## 1. Why This Pattern Is Bad
7
+
## 1. Limitations of the Current Approach
8
8
9
-
|Problem|Impact|
10
-
|---------|--------|
11
-
| Requires `gnmi` container running and healthy | DPU shutdown silently fails if gnmi is restarting|
12
-
| Subprocess + Docker CLI overhead per RPC | Extra process creation, Docker round-trip, stdout capture |
13
-
| Output is unstructured text with a header line |Any format change in`gnoi_client` breaks parsing|
14
-
| gRPC status codes are lost | Caller only sees `rc != 0` — no code, no details |
15
-
| Errors are Go `panic()` stack traces on stderr |Production diagnosis requires SSH + manual docker exec |
16
-
|`suppress_stderr=True`discards those panics | Error output goes to `/dev/null`, logs say only "command failed" |
17
-
|String matching for completion detection|`"reboot complete" in out_s.lower()`doesn't match actual output (see §2) |
18
-
| Tight coupling to CLI flag interface |`-module System -rpc Reboot -jsonin '{...}'`is a serialization layer we don't need|
19
-
|Security surface | Shell-out through Docker CLI is wider than a direct gRPC socket |
9
+
|Observation|Consequence|
10
+
|-------------|-------------|
11
+
| Requires `gnmi` container running and healthy | DPU shutdown depends on an unrelated container's availability|
12
+
| Subprocess + Docker CLI overhead per RPC | Extra process creation, Docker round-trip, stdout capture on each call |
13
+
| Output is unstructured text with a header line |Parsing is coupled to`gnoi_client`'s print format, which has no stability guarantee|
14
+
| gRPC status codes are not propagated | Caller only sees `rc != 0` — no status code, no error details |
15
+
| Errors surface as Go `panic()` stack traces on stderr |Diagnosing RPC failures requires SSH + manual docker exec |
16
+
|`suppress_stderr=True`on the Reboot call | Panic output is discarded; logs show only "command failed" |
17
+
|Completion check uses string matching|`"reboot complete" in out_s.lower()`does not match actual output format (see §2) |
18
+
| Tight coupling to CLI flag interface |`-module System -rpc Reboot -jsonin '{...}'`adds a serialization layer between caller and protobuf|
19
+
|Broader privilege surface | Shell-out through Docker CLI vs. a direct gRPC socket |
0 commit comments