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

[ignore] [WIP] prefork experiments #72057

Draft
wants to merge 12 commits into
base: devel
Choose a base branch
from
Draft

[ignore] [WIP] prefork experiments #72057

wants to merge 12 commits into from

Conversation

relrod
Copy link
Member

@relrod relrod commented Oct 1, 2020

SUMMARY

Ignore this for now.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

strategy

@relrod
Copy link
Member Author

relrod commented Oct 1, 2020

bot_skip

@relrod relrod added the WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. label Oct 1, 2020
task._uuid,
res,
task_fields=task.dump_attrs())
# TODO: TaskExecutor#run handles plain Exception too, should we do that?
Copy link
Contributor

@mkrizek mkrizek Oct 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we need to handle all exceptions that would be otherwise handled in TaskExecutor (_execute(), run()) and Worker.run().

if not self._task.evaluate_conditional(templar, variables):
display.debug("when evaluation is False, skipping this task")
return dict(changed=False, skipped=True, skip_reason='Conditional result was False', _ansible_no_log=self._play_context.no_log)
if from_loop:
Copy link
Contributor

@mkrizek mkrizek Oct 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial idea was to extract each step that we are going to move out of _execute and put them into own methods and use them where needed, it might be clearer than special casing from_loop.

mkrizek and others added 12 commits Jan 28, 2021
Change:
- Pull when evaluation out to MaybeWorker when we are not in a loop
  context.
- Let TE determine when it is in a loop context so that there is never a
  case where we evaluate the when condition twice.
- Handle edge case when we are in a loop context but don't run
  TaskExecutor#_run_loop() anyway.
- Fix WorkerShortCircuit in skip_worker_include_role so that it only
  includes a dict instead of a full TaskResult which isn't what
  FinalQueue#send_task_result expects.

Test Plan:
- Lots of hope

Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Rick Elrod <rick@elrod.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci_verified Changes made in this PR are causing tests to fail. WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants