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
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
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

No branches or pull requests

1 participant