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

Added alterantive childwatcher #7786

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelogs/unreleased/agent_executor_6_5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Make the server work as a child reaper
change-type: patch
destination-branches: [master]
sections:
minor-improvement: The server now also cleans up zombie processes, which is convenient when running in a container
Empty file.
8 changes: 8 additions & 0 deletions src/inmanta/server/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import importlib
import logging
import pkgutil
from asyncio import FastChildWatcher
from collections.abc import Generator
from pkgutil import ModuleInfo
from types import ModuleType
Expand Down Expand Up @@ -100,6 +101,13 @@ def __init__(self, configure_logging: bool = False) -> None:
inmanta_logger_config.apply_options(inmanta_logging.Options())

async def start(self) -> None:

# Use the fast child watcher
# It also servers as a reaper when the server is pid 1 in a container
childwatcher = FastChildWatcher()
childwatcher.attach_loop(asyncio.get_running_loop())
asyncio.set_child_watcher(childwatcher)

db_wait_time: int = config.db_wait_time.get()
if db_wait_time != 0:
# Wait for the database to be up before starting the server
Expand Down