Skip to content
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

Zbchaos worker has concurrency issues #288

Closed
ChrisKujawa opened this issue Dec 9, 2022 · 3 comments
Closed

Zbchaos worker has concurrency issues #288

ChrisKujawa opened this issue Dec 9, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ChrisKujawa
Copy link
Member

Right now we have implemented the zbchaos worker in a way that it just takes all the arguments from the experiment and calls the root command again with the given arguments.

Since we make use of globals in order to define flags this lead to heavy issues when running multiple commands after another (because properties/globals are not reset). Furthermore we can't execute multiple jobs at once, which is why we limited the max activation count to 1.

Quick fix: reset all properties in the worker
Long term solution: extract logic of commands and support parameters. Cobra Commands call the new logic/functions with the globals as parameters and the workers also call the new functions with parameters (instead of rely on globals) this makes it independent from the previous set of arguments from other actions/experiments.

For that we need a mapping of sub-commands to the functions, so we call the correct code.

When we implemented the long-term solution, we should be able also to handle more jobs concurrently. Needs to be verified since we use the kube-config

@ChrisKujawa ChrisKujawa added the bug Something isn't working label Dec 9, 2022
@ChrisKujawa ChrisKujawa self-assigned this Dec 9, 2022
@ChrisKujawa
Copy link
Member Author

Potentially we can also cover with this #253

@ChrisKujawa
Copy link
Member Author

Long term solution: extract logic of commands and support parameters. Cobra Commands call the new logic/functions with the globals as parameters and the workers also call the new functions with parameters (instead of rely on globals) this makes it independent from the previous set of arguments from other actions/experiments.

For that we need a mapping of sub-commands to the functions, so we call the correct code.

Drawback is that we have to parse on our own the flags, which is really mae.

I could think of creating the commands and adding them to a root command in a separate function and maybe creating such commands and flags on each job worker handling 🤔

@ChrisKujawa
Copy link
Member Author

We have overcome this with #289 we use always a new command an no longer globals,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant