Skip to content

Commit 9b4b7c7

Browse files
authored
spacetime start - Port available when in doubt (#5564)
# Description of Changes If we fail to check port availability, move forward as though it's available, to avoid being entirely borked in environments where we do not have permission to check port availability. Closes #5556. # API and ABI breaking changes None really. Technically technically an API change for the CLI, but not in a way that causes meaningful pain. # Expected complexity level and risk 1 # Testing Existing CI only. I have not tested this specific branch. Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
1 parent 484f3b5 commit 9b4b7c7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • crates/standalone/src/subcommands

crates/standalone/src/subcommands/start.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,12 @@ pub fn is_port_available(host: &str, port: u16) -> bool {
316316

317317
let sockets = match get_sockets_info(AddressFamilyFlags::IPV4 | AddressFamilyFlags::IPV6, ProtocolFlags::TCP) {
318318
Ok(s) => s,
319-
Err(_) => return false, // if we can't inspect sockets, fail closed
319+
Err(_) => {
320+
log::warn!("Unable to check whether port {port} is available. Proceeding as though it is.");
321+
// Default to allowing, because otherwise we can have cases where users are entirely unable to start servers.
322+
// See https://github.com/clockworklabs/SpacetimeDB/issues/5556.
323+
return true;
324+
}
320325
};
321326

322327
for si in sockets {

0 commit comments

Comments
 (0)