feat(env): manage multiple mutagen sessions and improve sync handling#918
Open
martin-cod wants to merge 5 commits into
Open
feat(env): manage multiple mutagen sessions and improve sync handling#918martin-cod wants to merge 5 commits into
martin-cod wants to merge 5 commits into
Conversation
- Get paused sessions: separate matching and mismatched containers - Terminate sessions with mismatched containers - Resume all valid paused sessions (warden filters by label automatically)
142aaca to
3c8313e
Compare
- Get all sessions for this environment (warden filters by label) - Terminate stale connected sessions (pointing to old containers) - Start sync only if zero connected sessions for current container
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Warden’s environment lifecycle command to better handle multiple Mutagen sync sessions for the same environment by detecting sessions tied to outdated containers, resuming valid paused sessions, and only starting a new session when none are connected.
Changes:
- Add
categorizeSyncSessions()to classify Mutagen sessions as matching/mismatching the currentphp-fpmcontainer. - On
env up/start, terminate mismatched sessions, resume paused matching sessions, and start sync only when no connected matching sessions exist. - Document the enhancement in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| commands/env.cmd | Implements multi-session-aware Mutagen termination/resume/start logic during env up/start/down. |
| CHANGELOG.md | Adds an UNRELEASED entry describing the multi-session resume/sync-handling improvement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check List
Is your feature request related to a problem? Please describe.
Previous versions of the environment management functionality did not support handling multiple Mutagen sessions simultaneously, which led to conflicts and insufficient synchronization handling for more complex development workflows. Users were frustrated by the inability to efficiently manage or monitor multiple live mutagen sync sessions within the same environment.
Describe the solution you've submitted
This PR introduces enhancements for managing multiple Mutagen sessions concurrently within the environment. It improves the sync session resuming logic, monitors several sync sessions in parallel. The changes include robust session tracking, improved error handling, and optimised status reporting for each session.
Mutagen sync session management step-by-step improvements:
$WARDEN_BIN sync listcommand because statuses were changed after mutagen sessions resumed.Describe alternatives you've considered
Alternatives considered include only supporting a single sync session at a time or using external scripts to manage multiple sessions outside the existing environment tooling. These approaches were disregarded due to their lack of integration and reduced user experience compared to the proposed comprehensive multi-session management.
Additional context
This PR still does not add the full-featured support of multiple mutagen sessions mentioned in #910. I.e. when the environment is created with
warden env up, only one mutagen session is still created. But, when parrallel mutagen session was started manually, now it will not be dropped and stopped/resumed correctly