-
Notifications
You must be signed in to change notification settings - Fork 23
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
macOS: clear runstate dir after instance stop #1450
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What goes in the runstate dir? When running the server locally in dev mode, the socket is in the postgres data dir, which would obviously be wrong here.
We're 100% sure this is safe?
src/portable/macos.rs
Outdated
|
||
// Clear the runstate dir - macOS wouldn't delete UNIX domain socket | ||
// files after server shutdown, which may lead to issues in upgrades | ||
fs::remove_dir_all(runstate_dir(name)?).ok(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should filter and remove only domain sockets if that is the problem. Something like this?
for entry in fs::read_dir(dir_path)? {
let entry = entry?;
let path = entry.path();
if let Ok(metadata) = path.metadata() {
if metadata.file_type().is_socket() {
fs::remove_file(&path)?;
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that'll do! Do you mind pushing that to the PR? I'm kinda in the middle of home moving. Thank you!
Thank you all! |
Refs edgedb/edgedb#8248, #1418
Manually tested with the repro in #1418