fix(glyph): parallelize mcpjungle server registration#343
Merged
Conversation
The mcpjungle-register oneshot service registered 9 servers sequentially, each polling up to 60s for availability. This blocked nixos-rebuild switch for up to 9 minutes in the worst case. Run each registration in a background subshell so all servers are polled concurrently, reducing worst-case wait to 60s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The mcpjungle-register oneshot service was in multi-user.target, causing nixos-rebuild switch to block until all 9 MCP servers were polled and registered (up to 60s even with parallel registration). Replace the direct wantedBy with a systemd timer that fires 5s after activation. The timer start/restart is instant so activation never blocks. The timer has restartTriggers based on the server config hash, so adding/removing servers re-triggers registration. The service itself has restartIfChanged = false to prevent NixOS from directly restarting (and blocking on) the oneshot during activation. Also parallelizes registrations within the script and removes RemainAfterExit since the timer handles re-triggering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Type=oneshot causes systemctl start to block until the script completes. Changing to Type=simple makes systemctl start return immediately — the registration script still runs to completion in the background. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Summary
mcpjungle-register.serviceblockednixos-rebuild switchbecause it was aType=oneshotinmulti-user.target, polling 9 servers sequentially (up to 9 min worst case)wantedBy = ["multi-user.target"]with a systemd timer that fires 5s after activation — timer start/restart is instant, never blocksType=oneshottoType=simpleso even if NixOS starts the service directly,systemctl startreturns immediatelyrestartTriggerson the timer keyed to server config hash, so adding/removing servers re-triggers registrationTest plan
nixos-rebuild switchcompletes without hangingmcpjungle-register.timeris active:systemctl status mcpjungle-register.timerjournalctl -u mcpjungle-register -f🤖 Generated with Claude Code