Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Feat/check status python process #1848

Merged
merged 9 commits into from
Jan 14, 2025

Conversation

nguyenhoangthuan99
Copy link
Contributor

@nguyenhoangthuan99 nguyenhoangthuan99 commented Jan 9, 2025

Describe Your Changes

Pull Request Summary: Add Process Status Check for PythonEngine Model Management

Overview

This pull request introduces a utility to check if a process is running and integrates this functionality into the PythonEngine class for enhanced model management. The primary focus is to ensure that model processes are effectively monitored, improving reliability and debuggability.

Key Changes

  1. Process Status Check Utility:

    • Introduced process_status_utils.h, a utility header to determine if a process is currently running.
    • Supports both Windows and Unix-like systems (Linux and macOS) using appropriate system calls.
  2. Integration with PythonEngine:

    • Enhanced the GetModelStatus method to utilize the new IsProcessRunning utility.
    • The method now verifies the live status of model processes and provides a more accurate response.
  3. Code Refactoring:

    • Included the newly created process_status_utils.h in python_engine.h to leverage the process status utility.
  4. Error Handling Improvements:

    • Improved error handling in the GetModelStatus function. It now correctly identifies when a model process is loading versus when it has encountered an error.

Detailed Modifications:

  • engine/extensions/python-engine/python_engine.cc:

    • Added checks for process activity using IsProcessRunning.
    • Improved callback response based on process and health check status.
  • engine/extensions/python-engine/python_engine.h:

    • Included process_status_utils.h for process management.
  • New File: engine/utils/process_status_utils.h:

    • Added inline utility function IsProcessRunning.
    • Implemented cross-platform checks for whether a given process ID is active.

This update focuses on enhancing the robustness of model lifecycle management within the PythonEngine, providing better feedback on the status of running models, and improving the system's overall reliability.

Copy link
Contributor

github-actions bot commented Jan 9, 2025

Preview URL: https://88e6b87c.cortex-docs.pages.dev

@nguyenhoangthuan99 nguyenhoangthuan99 merged commit bd9271c into dev Jan 14, 2025
13 checks passed
@nguyenhoangthuan99 nguyenhoangthuan99 deleted the feat/check-status-python-process branch January 14, 2025 03:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants