-
Notifications
You must be signed in to change notification settings - Fork 14.1k
server: (router) allow child process to report status via stdout #18110
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
base: master
Are you sure you want to change the base?
Conversation
|
I can confirm this works for Windows as well. |
|
I tested this PR with the following conditions: Tested different values of --host for these results:
Tested those abilities by attempting to connect on:
Results: --host 127.0.0.1 --host 192.168.xx.yy Thanks @ngxson for all your great work! :) |
ggerganov
left a comment
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.
This mechanism using stdout to communicate is a bit strange - not sure if it has any drawbacks.
I saw there were some issues with the old approach. Didn't get in the details. But assuming this fixes the problem, lets give it a try.
| } | ||
|
|
||
| std::thread server_models::setup_child_server(const common_params & base_params, int router_port, const std::string & name, std::function<void(int)> & shutdown_handler) { | ||
| std::thread server_models::setup_child_server(std::function<void(int)> & shutdown_handler) { |
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.
| std::thread server_models::setup_child_server(std::function<void(int)> & shutdown_handler) { | |
| std::thread server_models::setup_child_server(const std::function<void(int)> & shutdown_handler) { |
| #include <chrono> | ||
| #include <queue> | ||
| #include <filesystem> | ||
| #include <string.h> |
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.
| #include <string.h> | |
| #include <cstring> |
In case the router listen on a specific address other than 127.0.0.1, the child process will fail to report its status back to the router
This change complete replace this reporting mechanism to using pipe (stdout) instead.