Skip to content

Commit

Permalink
zippy,platform-checks: Clean up Process Orchestrator metadata on restart
Browse files Browse the repository at this point in the history
In order to work around MaterializeInc#15725, clean up the Progress Orchestrator
information on PIDs and TCP ports on restart. As the tests are running
in containers, the processes that may have held those PIDs and ports
are now gone anyway when environmentd restarts, as they lived in
the same container.

Relates to #MaterializeInc#15725, MaterializeInc#15155
  • Loading branch information
philip-stoev committed Oct 31, 2022
1 parent 49bfd3b commit 6341548
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions misc/python/materialize/checks/mzcompose_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ def execute(self, e: Executor) -> None:
mz = Materialized(image=image, options=StartMz.DEFAULT_MZ_OPTIONS)

with c.override(mz):
# Work around https://github.com/MaterializeInc/materialize/issues/15725
# by cleaning up Process Orchestrator metadata on restart
c.run(
"materialized",
"-c",
"rm -rf /mzdata/*.pid /mzdata/*.ports",
entrypoint="bash",
)
c.up("materialized")

c.wait_for_materialized()
Expand Down
2 changes: 2 additions & 0 deletions misc/python/materialize/mzcompose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ def run(
env_extra: Dict[str, str] = {},
capture: bool = False,
stdin: Optional[str] = None,
entrypoint: Optional[str] = None,
) -> subprocess.CompletedProcess:
"""Run a one-off command in a service.
Expand All @@ -490,6 +491,7 @@ def run(
self.invoke("up", "--detach", "--scale", f"{service}=0", service)
return self.invoke(
"run",
*(["--entrypoint", entrypoint] if entrypoint else []),
*(f"-e{k}={v}" for k, v in env_extra.items()),
*(["--detach"] if detach else []),
*(["--rm"] if rm else []),
Expand Down
9 changes: 9 additions & 0 deletions misc/python/materialize/zippy/mz_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ class MzStart(Action):
"""Starts a Mz instance (all components are running in the same container)."""

def run(self, c: Composition) -> None:
# Work around https://github.com/MaterializeInc/materialize/issues/15725
# by cleaning up Process Orchestrator metadata on restart
c.run(
"materialized",
"-c",
"rm -rf /mzdata/*.pid /mzdata/*.ports",
entrypoint="bash",
)

c.up("materialized")
# Loaded Mz environments take a while to start up
c.wait_for_materialized(timeout_secs=300)
Expand Down

0 comments on commit 6341548

Please sign in to comment.