superlance | Superlance utilities for use with the Supervisor process | BPM library
kandi X-RAY | superlance Summary
kandi X-RAY | superlance Summary
Superlance utilities for use with the Supervisor process control system
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Main loop
- Perform action on supervisor
- Restart a process
- Mail the email
- Run the main loop
- Calculate the total number of processes for a given pid
- Emails the mail
- Parse command line arguments
- Parse name and size
- Parse byte_size value
- Parse the given value in seconds
- Run the process until the process finishes
- Mail the user
- Create a listener from the command line options
- Create an option parser
- Validate command line options
- Parse command line options
- Send batch notification
- Send email
- Get the email message
- Logs an email
- The main thread
- Handle an event
- Handle ProcessStateChange events
- Handle a single tick event
superlance Key Features
superlance Examples and Code Snippets
Community Discussions
Trending Discussions on superlance
QUESTION
I have a number of Python workers managed by supervisord that should continuously print to stdout (after each completed task) if they are working properly. However, they tend to hang, and we've had difficulty finding the bug. Ideally supervisord would notice that they haven't printed in X minutes and restart them; the tasks are idempotent, so non-graceful restarts are fine. Is there any supervisord feature or addon that can do this? Or another supervisor-like program that has this out of the box?
We are already using http://superlance.readthedocs.io/en/latest/memmon.html to kill if memory usage skyrockets, which mitigates some of the hangs, but a hang that doesn't cause a memory leak can still cause the workers to reach a standstill.
...ANSWER
Answered 2017-May-31 at 08:29One possible solution would be to wrap your python script in a bash script that'd monitor it and exit if there isn't output to stdout for a period of time.
For example:
kill-if-hung.sh
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install superlance
You can use superlance like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page