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

Check for a running process should be more fine-grained #468

Open
mr-cal opened this issue Nov 29, 2023 · 0 comments
Open

Check for a running process should be more fine-grained #468

mr-cal opened this issue Nov 29, 2023 · 0 comments
Labels
Enhancement New feature or request

Comments

@mr-cal
Copy link
Collaborator

mr-cal commented Nov 29, 2023

What needs to get done

Improve the granularity of the check that checks if the process that launched an instance is still active.

Currently, craft-providers will only check that the PID that created an instance exists. This could be improved by checking that /proc/<pid>/cmdline is a python process.

Suggested by @syu-w in #464 (comment)

Why it needs to get done

If the PID that launched the instance is currently in-use by another process, it may add a 60 second delay before the instance is auto-cleaned.

Consider a scenario where craft-providers created a base instance with pid 100, but the instance was not fully setup and pid 100 is now assigned to another active process (due to a reboot or the pid counter being reset).

Current behavior

  1. Craft-providers sees the base instance is not ready and pid 100 is active
  2. Craft-providers waits for the instance to be ready. If it is not ready and the instance's timer hasn't changed in 60 seconds, then it auto-cleans the instance.

New behavior

  1. Craft-providers sees the base instance is not ready and that pid 100 is active but not a python process.
  2. Craft-providers immediately auto-cleans the instance.
@mr-cal mr-cal added the Enhancement New feature or request label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant