Skip to content

Error handling for Launcher exits#3798

Open
domenukk wants to merge 2 commits intomainfrom
launcher_exit
Open

Error handling for Launcher exits#3798
domenukk wants to merge 2 commits intomainfrom
launcher_exit

Conversation

@domenukk
Copy link
Copy Markdown
Member

@domenukk domenukk commented Apr 12, 2026

Description

Fixes CI a bit more

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

};
match res {
Ok(()) => unreachable!(),
Ok(()) => (),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this shouldn't be the case; forkserver should never return "Ok", this should indeed be unreachable.

Comment on lines 655 to 660
#[cfg(unix)]
let use_fork = self.fork;
#[cfg(not(unix))]
let use_fork = false;

if use_fork {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with if cfg!(unix)

Self::wait_for_child_processes(&mut handles, self.spawn_broker)?;
}
Ok(())
Err(Error::shutting_down())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this line

}

Self::wait_for_child_processes(&mut handles, self.spawn_broker);
Self::wait_for_child_processes(&mut handles, self.spawn_broker)?;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete ?;

}

Self::wait_for_pids(&handles, self.spawn_broker);
Self::wait_for_pids(&handles, self.spawn_broker)?;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete ?;.

Comment on lines 767 to 771
// This is the fork part for unix
#[cfg(not(unix))]
{
unreachable!("Forking not supported");
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete all of these.

} else {
log::info!("Client with pid {handle} exited with status {status}");
crash_count += 1;
reasons.push(format!("Exited with status {status}"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will get formatted weird by :?, maybe just push the status codes?

if let Some(sig) = ecode.signal() {
if sig != libc::SIGINT && sig != libc::SIGTERM {
crash_count += 1;
reasons.push(format!("Killed by signal {sig}"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here, might be better to make a function-specific derived-debug enum with Killed(c_int), Exited(c_int) and push them here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants