-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
The graceful shutdown function causes the process to hang when exiting. #923
Comments
I'm running on windows. I have also had problems with the server hanging on "salvo_core::server: wait for all connections to close" which never seems to return. I have a endpoint that signals shutdown and I have tried both handle.stop_graceful(None) and handle.stop_forible(), I have also scheduled the shutdowns to occur after the endpoint returns without success. I was going to attempt a time wait.
The waiting occurs even when stop_forible() is called.
I can work on a sample that demonstrates. |
I forked and that works fine for testing modifications. I am able to force close and exit the app, but I am still holding the port open after termination when run from a detached process of the server. If I run it from cmd.exe separately, it does close the port. There's something about being detached from the server and asking the server to exit that causes issue for me. |
I think the detached process is holding the socket open from inheritance.
the other thing to try is:
I'm not sure how to get the raw handle. I will keep trying. |
I implemented
and tried setting
this is no good; as we need a HANDLE and not a SOCKET. I don't see a good safe way to do this. it's annoying inheritance is on by default on windows sockets. at this point I have confirmed the inheritance is the problem for my hanging connection.
using the above I'm able to run commands that don't inherit the socket. I can run 'cargo run --release' and 'cargo run' and the two instances will close each other and grab 5800 accordingly. All my calls to Command::spawn() have to be replaced with spawn_detached() - not a huge deal. maybe there's a better way. this works for me for now; maybe not a concern of salvo. @andeya is on ubuntu and another concern most likely. @andeya can you say any more about what is going on when this occurs. from the cap it looks like https://github.com/neosmart/rsproxy? I still think there might be a need for
I need to come up with a good way to test the graceful shutdowns and would like to understand how you're using rsproxy to experience your concern @andeya |
Describe the bug
After enabling graceful shutdown, the process often gets stuck when exiting and can only be resolved by forcefully killing the process.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: