Commit d37a381
authored
ereport: Task faulted/panicked (#2341)
Depends on #2313, #2350, #2358
Fixes #2309
It's currently somewhat difficult to become aware of Hubris task panics
and other task faults in a production environment. While MGS can ask the
SP to list task dumps as part of the API for reading dumps, this
requires that the control plane (or faux-mgs user) proactively ask the
SP whether it has any record of panicked tasks, rather than recording
panics as they occur. Therefore, we should have a proactive notification
from the SP indicating that task faults have occurred.
This commit adds code to `packrat` for producing an ereport when a task
has faulted. This could eventually be used by the control plane to
trigger dump collection and produce a service bundle. In addition, it
will provide a more permanent record that a task faulted at a particular
time, even if the SP that contains the faulted task is later reset or
replaced with an entirely different SP. This works using an approach
similar to the one described by @cbiffle in [this comment][1]. There's a
detailed description of how this works [in the module-level RustDoc for
`ereport.rs` in Packrat][2].
The ereports that come out of this thing look like this:
```console
eliza@hekate ~/Code/oxide/hubris $ faux-mgs --interface eno1np0 --discovery-addr '[fe80::0c1d:deff:fef0:d922]:11111' ereports
Jan 15 10:27:41.370 INFO creating SP handle on interface eno1np0, component: faux-mgs
Jan 15 10:27:41.372 INFO initial discovery complete, addr: [fe80::c1d:deff:fef0:d922%2]:11111, interface: eno1np0, socket: control-plane-agent, component: faux-mgs
restart ID: 4e54b7f1-e13a-d9bb-709a-c7e863d64a64
restart IDs did not match (requested 00000000-0000-0000-0000-000000000000)
count: 4
ereports:
0x1: {
"ereport_message_version": Number(0),
"hubris_task_gen": Number(0),
"hubris_task_name": String("packrat"),
"hubris_uptime_ms": Number(0),
"lost": Null,
}
0x2: {
"ereport_message_version": Number(0),
"hubris_task_gen": Number(0),
"hubris_task_name": String("ereportulator"),
"hubris_uptime_ms": Number(378010),
"k": String("hubris.fault.panic"),
"msg": String("panicked at task/ereportulator/src/main.rs:158:9:\nim dead lol"),
"v": Number(0),
}
0x3: {
"by": Object {
"gen": Number(0),
"task": String("jefe"),
},
"ereport_message_version": Number(0),
"hubris_task_gen": Number(0),
"hubris_task_name": String("user_leds"),
"hubris_uptime_ms": Number(382914),
"k": String("hubris.fault.injected"),
"v": Number(0),
}
0x4: {
"by": Object {
"gen": Number(0),
"task": String("jefe"),
},
"ereport_message_version": Number(0),
"hubris_task_gen": Number(1),
"hubris_task_name": String("ereportulator"),
"hubris_uptime_ms": Number(388215),
"k": String("hubris.fault.injected"),
"v": Number(0),
}
```
[1]:
#2309 (comment)
[2]:
https://github.com/oxidecomputer/hubris/blob/1e2b121fcd165dcdbcbdfdc69c36d35520dfa954/task/packrat/src/ereport.rs#L15-L951 parent aa7951c commit d37a381
File tree
16 files changed
+690
-33
lines changed- app
- cosmo
- gimletlet
- gimlet
- grapefruit
- oxcon2023g0
- psc
- sidecar
- idl
- sys/kern/src
- task
- ereportulator
- src
- packrat
- src
16 files changed
+690
-33
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
131 | | - | |
| 134 | + | |
132 | 135 | | |
133 | | - | |
134 | | - | |
| 136 | + | |
135 | 137 | | |
| 138 | + | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
125 | | - | |
| 128 | + | |
126 | 129 | | |
127 | | - | |
128 | | - | |
| 130 | + | |
129 | 131 | | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
121 | | - | |
| 124 | + | |
122 | 125 | | |
123 | | - | |
124 | | - | |
| 126 | + | |
125 | 127 | | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
260 | | - | |
| 263 | + | |
261 | 264 | | |
262 | | - | |
263 | | - | |
| 265 | + | |
264 | 266 | | |
| 267 | + | |
265 | 268 | | |
266 | 269 | | |
267 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | 485 | | |
492 | 486 | | |
493 | 487 | | |
| |||
0 commit comments