Skip to content

Commit c28e6e4

Browse files
authored
[mgs] Don't drop the ereport socket (#8583)
Turns out that dropping this cancels the receive handler task for the ereport socket, which results in ereport collection being totally busted. This wasn't caught until I actually tested the system end-to-end on a racklette with a real SP emitting ereports, since the omicron integration tests don't actually use a single shared socket, and `faux-mgs` just puts it on the stack, so none of this was actually exercised outside of a production-like environment. Cool. Shoutout to @mkeeter for finding the bug!
1 parent a081b31 commit c28e6e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gateway/src/management_switch.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ pub struct ManagementSwitch {
161161
// When it's dropped, it cancels the background tokio task that loops on
162162
// that socket receiving incoming packets.
163163
_shared_socket: Option<SharedSocket<shared_socket::SingleSpMessage>>,
164+
// As above, we must also not drop the shared ereport socket.
165+
_shared_ereport_socket: Option<SharedSocket<Vec<u8>>>,
164166
location_map: Arc<OnceLock<Result<LocationMap, String>>>,
165167
discovery_task: JoinHandle<()>,
166168
log: Logger,
@@ -336,6 +338,7 @@ impl ManagementSwitch {
336338
local_ignition_controller_port,
337339
location_map,
338340
_shared_socket: shared_socket,
341+
_shared_ereport_socket: ereport_socket,
339342
port_to_handle,
340343
port_to_ignition_target,
341344
discovery_task,

0 commit comments

Comments
 (0)