Skip to content

Wait to recreate a module until dependencies and ports are free - #391

Merged
athNdev merged 3 commits into
mainfrom
oss/243-module-gates
Nov 10, 2026
Merged

athNdev merged 3 commits into
mainfrom
oss/243-module-gates

Conversation

@athNdev

@athNdev athNdev commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • A module reconcile pass returns a waiting outcome and leaves the row unchanged while a declared dependency is not running, so it neither reports the module in sync nor recreates it.
  • Before recreate, the pass re-checks each published host port on Module.Ports with the same store and daemon reservation checks as module create, and waits when another consumer holds the port.
  • The decision stays a pure function; daemon port listing stays behind the module manager.

Test plan

  • go test ./internal/module/ -count=1 -timeout 180s
  • go vet ./internal/module/
  • go run ./cmd/knowledge-lint -root . -fix and a second run without -fix
  • Confirm a running module with a stopped dependency is not recreated and stays out of sync
  • Confirm recreate waits when another consumer holds a published host port, then proceeds once the port is free

Made with Cursor

athNdev and others added 3 commits November 10, 2026 15:12
…ree.

A sidecar that starts against a down dependency or a taken port drifts from the create path and can duplicate listeners.

Co-authored-by: Cursor <[email protected]>
Dependency and host-port readiness must match module start so reconcile neither marks in sync nor recreates while blocked.

Co-authored-by: Cursor <[email protected]>
@athNdev
athNdev merged commit 645a7fc into main Nov 10, 2026
11 checks passed
@athNdev
athNdev deleted the oss/243-module-gates branch November 10, 2026 04:26
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.

1 participant