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 docker heartbeat #35

Closed
wants to merge 4 commits into from

Conversation

Courey
Copy link
Contributor

@Courey Courey commented May 8, 2024

Description

This creates a heartbeat that checks to see if the main process is still running every 10 seconds. If the main process is running, it waits another 10 seconds before checking again. If the main process is not running, it kills the docker container by id.

Related Issue(s)

Resolves #34

Testing

I have just tested this locally on mac.

Copy link
Member

@lpsinger lpsinger left a comment

Choose a reason for hiding this comment

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

ps` may not be present on Windows systems. There are other ways to check if the erstwhile parent process is still running.

@lpsinger
Copy link
Member

The child_process.fork method will launch a new Node.js process with an interprocess communication channel between the parent and the chid processes.

@Courey
Copy link
Contributor Author

Courey commented May 10, 2024

The child_process.fork method will launch a new Node.js process with an interprocess communication channel between the parent and the chid processes.

Where is it forking? to create the monitoring process, I spawn it in detached mode with stdio ignored, there is no channel between the parent and child.

@Courey
Copy link
Contributor Author

Courey commented May 10, 2024

and it's unreffed for complete separation.

@lpsinger
Copy link
Member

The child_process.fork method will launch a new Node.js process with an interprocess communication channel between the parent and the chid processes.

Where is it forking? to create the monitoring process, I spawn it in detached mode with stdio ignored, there is no channel between the parent and child.

I don't understand your question. I think that you are confusing interprocess communication and stdin/stdout.

@Courey Courey closed this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test docker healthcheck
2 participants