-
Notifications
You must be signed in to change notification settings - Fork 5
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
Override env vars #241
Override env vars #241
Conversation
include/aos/sm/launcher/instance.hpp
Outdated
const EnvVarsArray& GetOverrideEnvVars() const { return mOverrideEnvVars; }; | ||
|
||
/** | ||
* Sets |
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.
* Sets | |
* Sets instance override env vars. |
include/aos/sm/launcher/instance.hpp
Outdated
/** | ||
* Returns instance override env vars. | ||
* | ||
* @return EnvVarsArray. |
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.
* @return EnvVarsArray. | |
* @return const EnvVarsArray&. |
src/sm/launcher/launcher.cpp
Outdated
mCurrentInstances.RemoveIf( | ||
[&info](const Instance& instance) { return instance.InstanceID() == info.mInstanceID; }); | ||
// Skip already stopped instances | ||
if (GetInstance(info.mInstanceID) == mCurrentInstances.end()) { |
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.
Looks like a typo:
I've expected the next condition:
if (GetInstance(info.mInstanceID) == mCurrentInstances.end()) { | |
if (GetInstance(info.mInstanceID) != mCurrentInstances.end()) { |
ddd3606
to
8e6f4c2
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #241 +/- ##
===========================================
- Coverage 86.56% 83.58% -2.98%
===========================================
Files 85 157 +72
Lines 7448 13712 +6264
Branches 0 1709 +1709
===========================================
+ Hits 6447 11461 +5014
- Misses 1001 2251 +1250 ☔ View full report in Codecov by Sentry. |
src/sm/launcher/launcher.cpp
Outdated
|
||
Error Launcher::UpdateInstancesEnvVars() | ||
{ | ||
auto restartInstances = SharedPtr<Array<InstanceData>>(&mAllocator, new (&mAllocator) InstanceDataStaticArray()); |
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.
Can we use make shared?
auto restartInstances = SharedPtr<Array<InstanceData>>(&mAllocator, new (&mAllocator) InstanceDataStaticArray()); | |
auto restartInstances = MakeShared<InstanceDataStaticArray>(mAllocator); |
12f45f9
to
3ffd482
Compare
Instance should be remove in current instances map, as this method will be used for restart instances as well. Signed-off-by: Oleksandr Grytsov <[email protected]>
Signed-off-by: Oleksandr Grytsov <[email protected]>
Signed-off-by: Oleksandr Grytsov <[email protected]>
Signed-off-by: Oleksandr Grytsov <[email protected]>
Signed-off-by: Oleksandr Grytsov <[email protected]>
Using value in list node requires list element to always have default constructor. It is not possible in some cases. Use buffer and cast it to value to properly handle items without default constructor. Signed-off-by: Oleksandr Grytsov <[email protected]>
During process instances (namely stop instances) concurrently, we remove instances from array. It leads to array rearrangement, as result currently processed instances may point to wrong place. Use list instead of array to avoid this issue. Signed-off-by: Oleksandr Grytsov <[email protected]>
3ffd482
to
36b8ae5
Compare
Quality Gate failedFailed conditions |
No description provided.