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

Gracefully exit on stop, new logger and rustyline #557

Merged
merged 5 commits into from
Feb 18, 2025

Conversation

kralverde
Copy link
Contributor

Description

This PR gracefully exits on a SIGXXX signal or stop command.

Rustyline needed to be replaced with an async version because the originally was blocking and could not be interrupted, leaving the terminal in raw mode after the server terminated.

The logger needed to be updated to a logger that supports files to work with the new rusty line to pretty print logs while still having the user input.

Testing

Please follow our Coding Guidelines

@Snowiiii
Copy link
Collaborator

Would be great if you could somehow get spawn chunks to get saved as well

@kralverde
Copy link
Contributor Author

kralverde commented Feb 17, 2025

Spawn chunks should be saved now @Snowiiii

@Snowiiii
Copy link
Collaborator

I noticed that log level is not colorful anymore, Any way to get the color back ?

@Snowiiii
Copy link
Collaborator

I'm also not fully sure about simplelog, Are there any other alternatives we can use ?

@kralverde
Copy link
Contributor Author

I noticed that log level is not colorful anymore, Any way to get the color back ?

Yeah, it has color settings

@kralverde
Copy link
Contributor Author

I'm also not fully sure about simplelog, Are there any other alternatives we can use ?

Any logger that supports writing to file should work, but this is the only one I've found

@kralverde
Copy link
Contributor Author

Colors should work now @Snowiiii

@kralverde
Copy link
Contributor Author

This should also fix

thread 'main' panicked at /home/minecraft/Pumpkin/pumpkin/src/lib.rs:149:74:
called `Result::unwrap()` on an `Err` value: Os { code: 24, kind: Uncategorized, message: "Too many open files" }
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

When continuous running

@Snowiiii
Copy link
Collaborator

Looks good. I also noticed that the deadlock which happens sometimes on Join is fixed and also command arguments in Console.

Thank you @kralverde

@Snowiiii Snowiiii merged commit a0d3a71 into Pumpkin-MC:master Feb 18, 2025
10 checks passed
@Yimura Yimura mentioned this pull request Feb 25, 2025
1 task
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