Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SP serial console doesn't detach stale faux-mgs clients on an idle console #1796

Open
jgallagher opened this issue May 21, 2024 · 0 comments · May be fixed by #1925
Open

SP serial console doesn't detach stale faux-mgs clients on an idle console #1796

jgallagher opened this issue May 21, 2024 · 0 comments · May be fixed by #1925
Labels
developer-experience Fixing this would have a positive impact on developer experience gimlet service processor Related to the service processor. 👋 good first issue Good for newcomers.

Comments

@jgallagher
Copy link
Contributor

faux-mgs allows us to attach to a gimlet's serial console via the SP. While faux-mgs is running, it ensures it's regularly sending serial console-related packets (either writes if there's data, or keeepalives if there isn't). On a clean exit, faux-mgs will detach itself from the console. But on a non-clean exit, the SP is responsible for eventually timing out the connection and allowing new attach requests. However, it looks like only check for staleness at

// Do we have an attached MGS instance that hasn't gone stale?
let (mgs_addr, sp_port) = match &self.attached_serial_console_mgs {
Some(attached) => {
// Check whether we think this client has disappeared
let client_age_ms = sys_get_timer()
.now
.saturating_sub(attached.last_keepalive_received);
if Duration::from_millis(client_age_ms)
> SERIAL_CONSOLE_IDLE_TIMEOUT
{
self.usart.clear_rx_data();
self.attached_serial_console_mgs = None;
return None;
}
(attached.address, attached.port)
}
None => {
// Discard any buffered data and reset any usart-related timers.
self.usart.clear_rx_data();
return None;
}
};

This is inside the code path for "the SP has serial console data to send to faux-mgs". If the console is idle (e.g., someone left it sitting at a shell prompt), the SP will never send data, so will never realize the faux-mgs client has gone away. This isn't a major problem, because faux-mgs can forcibly detach any previous session, but it is annoying because it makes it look like there might be someone else on the console when there isn't. A pretty easy fix would be to also check for staleness in serial_console_attach().

@jgallagher jgallagher added 👋 good first issue Good for newcomers. service processor Related to the service processor. developer-experience Fixing this would have a positive impact on developer experience gimlet labels May 21, 2024
last-genius added a commit to last-genius/hubris that referenced this issue Nov 19, 2024
requests

As suggested in oxidecomputer#1796.

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
last-genius added a commit to last-genius/hubris that referenced this issue Nov 19, 2024
requests

Factors out existing check that was used when sending new packets to
also detach stale clients in serial_console_attach()

As suggested in oxidecomputer#1796.

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience Fixing this would have a positive impact on developer experience gimlet service processor Related to the service processor. 👋 good first issue Good for newcomers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant