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

Process Spawner: protect against races between TERM and KILL #5805

Merged
merged 1 commit into from Nov 16, 2023

Conversation

clebergnu
Copy link
Contributor

Because a task (usually a test) can simply finish by itself, either before a TERM or between a TERM and a KILL, it's important to protect against the process not existing anymore.

File "/Users/runner/work/avocado/avocado/avocado/plugins/spawners/process.py",
line 87, in terminate_task
runtime_task.spawner_handle.process.kill()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/subprocess.py",
line 143, in kill
self._transport.kill()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_subprocess.py",
line 153, in kill
self._check_proc()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_subprocess.py",
line 142, in _check_proc
raise ProcessLookupError()

The following is an exercept from a stacktrace when the situation hits.

Because a task (usually a test) can simply finish by itself, either
before a TERM or between a TERM and a KILL, it's important to protect
against the process not existing anymore.

   File "/Users/runner/work/avocado/avocado/avocado/plugins/spawners/process.py",
   line 87, in terminate_task
   runtime_task.spawner_handle.process.kill()
   File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/subprocess.py",
   line 143, in kill
   self._transport.kill()
   File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_subprocess.py",
   line 153, in kill
   self._check_proc()
   File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_subprocess.py",
   line 142, in _check_proc
   raise ProcessLookupError()

The following is an exercept from a stacktrace when the situation
hits.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
@mr-avocado
Copy link

mr-avocado bot commented Nov 16, 2023

Dear contributor,
Avocado is currently under sprint #103, which is due to release an LTS (Long Term Stability) release.
Please avoid merging changes that do not fall into these categories:

  • Bug fixes
  • Usability Improvements
  • Documentation updates

As for the Avocado utility modules (“avocado.utils”) it is OK to introduce new functionality,
but changes to the existing APIs (including interface and behavior) should be avoided.
These kind of changes should wait until sprint #104.

@richtja richtja merged commit 68b7bb8 into avocado-framework:master Nov 16, 2023
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants