Running prefect local agent in a docker container leads to zombie apocalypse ;-)
See original GitHub issueDescription
I’m running prefect agent
inside of a Docker container with local execution. Each run of the process leaves a zombie process, a phenomenon which if left unchecked eventually causes deleterious effects. I noticed this because I was at one point unable to ssh into the node on which the container was running.
Expected Behavior
Somehow the completed processes should be harvested to remove the zombies.
Reproduction
My shell script does
exec prefect agent start -t $prefect_runner_token
(note: removing the exec
doesn’t help). Here’s a simple script to create a flow that runs on a schedule:
import prefect
from prefect import Flow, task
from prefect.schedules import IntervalSchedule
from datetime import timedelta, datetime
import time
schedule = IntervalSchedule(
start_date=datetime.utcnow() + timedelta(seconds=1),
interval=timedelta(minutes=2),
)
@task
def run():
logger = prefect.context.get("logger")
results = []
for x in range(3):
results.append(str(x + 1))
logger.info("Hello! run {}".format(x + 1))
time.sleep(3)
return results
with Flow("Hello", schedule=schedule) as flow:
results = run()
flow.register(project_name="Hello")
Environment
The container is built on CentOS 7.3. It does not have an init process.
{
"config_overrides": {},
"env_vars": [],
"system_information": {
"platform": "Linux-3.10.0-957.21.3.el7.x86_64-x86_64-with-glibc2.10",
"prefect_version": "0.10.4",
"python_version": "3.8.2"
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10
Top Results From Across the Web
Local Agent | Prefect Docs
Running without an init process may result in lingering zombie processes accumulating in your container. If you're using the official Prefect docker images...
Read more >Untitled
2 all ask's the player if they want to guess the whole word and says if it is ... word and finds the...
Read more >U5L1-Spell-Checker.xml - The Beauty and Joy of Computing
Take any number of input lists, and create a new list containing the items of ... ,wide,subject,door,image,loans,material,improve,ground,regarding,leading ...
Read more >123456 12345 123456789 password iloveyou princess
... 22222222 sterling rachel1 mystery m123456 locura hillary arsenal1 LOVELY zombie monse jesus777 future carpediem bunnies brebre 1122334455 werty sheldon ...
Read more >Sentiment Analysis on Amazon Product (RNN-97% Acc)
Explore and run machine learning code with Kaggle Notebooks | Using data from ... kaggle/python docker image: https://github.com/kaggle/docker-python # For ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think that’s reasonable—a doc fix would be great to consider!
Here’s the conda environment, re-creatable with
The file: