-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(process): proc status lost when streaming #3417
base: master
Are you sure you want to change the base?
fix(process): proc status lost when streaming #3417
Conversation
Quality Gate passedIssues Measures |
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.
Could you add documentation blocks for the new methods in the header file (not in the cpp file)?
done. |
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've added some comment style suggestion, based on the feedback I've got from RA in my other commits.
Also I've found some other issues with the env
that I would like you to fix. Sorry, that such a simple PR turned out to explode. If you prefer I can also take over the requested changes, just let me know.
src/process.cpp
Outdated
@@ -698,7 +714,11 @@ namespace proc { | |||
auto proc_opt = proc::parse(file_name); |
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)
to std::optional<std:tuple<std::vector<ctx_t>, boost::process::v1::environment>> parse(const std::string &file_name)
and also remove proc_t
constructor as it is another disaster waiting to happen (don't forget to initialize int _app_id{0};
)
// Update the process object with the new environment and apps | ||
// And, keep app running status. | ||
|
||
proc.set_env(proc_opt->get_env()); |
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.
After looking into this I have found another bug related to _env
. It is used in terminate
function, this means we have to preserve the _env
until process terminates :/
The moment we call execute
we should copy the _env
to a member variable _app_env
(name is debatable) and replace every usage of _env
within execute
and terminate
with _app_env
(except the first one where we copy it of course). Or we could store the new ENV to _current_env
and the in execute copy it (_env = _current_env
). I prefer the first renaming option, but whatever is easier is ok.
Also @ReenigneArcher, why do we use Is |
Not sure exactly where that code comes from, but 0 is the first app. |
But then we have a lot of places in the code checking We should change the |
That whole system problem needs to be re-thought. As far as I see, |
Quality Gate passedIssues Measures |
I would prefer if you could take over the requested changes. Thank you! 😀 |
@ReenigneArcher I will move some data around without changing logic too much. This should automatically resolve all of the known issues. |
@MiroKaku Have you perhaps unchecked the checkbox where maintainers or something can push to the branch? If so, can you enable it? Otherwise I will have to create a fork :/ |
It is checked, but I don't think it allows "Collaborators" to push to. |
I will create a fork then. |
Description
Steps to reproduce:
Reason:
Screenshot
None
Issues Fixed or Closed
None
Type of Change
.github/...
)Checklist