-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(process): proc status lost when streaming #3417
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?
Changes from 3 commits
327ce77
dae0997
c70404a
fb78d68
c53681a
1352925
04947f3
06ad747
6a1465b
56d0699
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -362,6 +362,10 @@ namespace proc { | |
proc_t::get_apps() { | ||
return _apps; | ||
} | ||
void | ||
proc_t::set_apps(std::vector<ctx_t> apps) { | ||
_apps = std::move(apps); | ||
} | ||
|
||
// Gets application image from application list. | ||
// Returns image from assets directory if found there. | ||
|
@@ -382,6 +386,19 @@ namespace proc { | |
return _app.name; | ||
} | ||
|
||
const boost::process::v1::environment & | ||
proc_t::get_env() const { | ||
return _env; | ||
} | ||
boost::process::v1::environment & | ||
proc_t::get_env() { | ||
return _env; | ||
} | ||
void | ||
proc_t::set_env(boost::process::v1::environment env) { | ||
_env = std::move(env); | ||
} | ||
|
||
proc_t::~proc_t() { | ||
// It's not safe to call terminate() here because our proc_t is a static variable | ||
// that may be destroyed after the Boost loggers have been destroyed. Instead, | ||
|
@@ -716,7 +733,8 @@ namespace proc { | |
auto proc_opt = proc::parse(file_name); | ||
|
||
if (proc_opt) { | ||
proc = std::move(*proc_opt); | ||
proc.set_env(proc_opt->get_env()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After looking into this I have found another bug related to The moment we call |
||
proc.set_apps(proc_opt->get_apps()); | ||
} | ||
} | ||
} // namespace proc |
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 strongly suggest to change signature of
std::optional<proc::proc_t> parse(const std::string &file_name)
tostd::optional<std:tuple<std::vector<ctx_t>, boost::process::v1::environment>> parse(const std::string &file_name)
and also removeproc_t
constructor as it is another disaster waiting to happen (don't forget to initializeint _app_id{0};
)