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

Add pid tracking to async_wrapper, add terminate functionality to async_status #77196

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

Conversation

sivel
Copy link
Member

@sivel sivel commented Mar 3, 2022

SUMMARY

Add pid tracking to async_wrapper, add terminate functionality to async_status

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

lib/ansible/modules/async_status.py

ADDITIONAL INFORMATION

@sivel
Copy link
Member Author

sivel commented Mar 3, 2022

---
- hosts: localhost
  gather_facts: false
  tasks:
    - command: sleep 100
      async: 100
      poll: 0
      register: result
    - async_status:
        jid: '{{ result.ansible_job_id }}'
    - async_status:
        jid: '{{ result.ansible_job_id }}'
        mode: terminate
    - async_status:
        jid: '{{ result.ansible_job_id }}'
      register: fail_result
      ignore_errors: true
    - assert:
        that:
          - fail_result is failed

@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.13 feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Mar 3, 2022
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Mar 3, 2022
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Mar 3, 2022
@mattclay
Copy link
Member

mattclay commented Mar 4, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sivel sivel marked this pull request as ready for review March 9, 2022 16:08
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. labels Mar 9, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 17, 2022
type: str
choices: [ cleanup, status ]
choices: [ cleanup, status, terminate ]
Copy link
Member

Choose a reason for hiding this comment

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

we should add note that 'terminate' was added in version 2.13

Copy link
Member

Choose a reason for hiding this comment

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

or move to 'dictionary' choices which can have their own version_added

finished=data['finished'],
msg="Missing pid, cannot terminate"
)
else:
Copy link
Member

Choose a reason for hiding this comment

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

can remove this else:

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Mar 29, 2022
@sivel sivel marked this pull request as draft July 14, 2022 21:12
@ansibot ansibot added the WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. label Jul 14, 2022
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Jul 12, 2023
@VannTen
Copy link

VannTen commented Dec 8, 2023

Hi.

Still working on this ? If not, would you mind me picking it up and trying to get it merged ?
I working on something which could benefit from that feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.13 feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. 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.

6 participants