fix(workers): keep a worker that is down in the site's declared set - #1628
Merged
Conversation
The workers list in a site's .lerd.yaml is what lerd start brings back, and it was rewritten after every worker action as the set of workers running at that moment. A worker that was merely down when an unrelated one was started or stopped was not in that snapshot and was written out of the file, and nothing put it back, so from then on it never started again. That is how a crash-looping worker disappeared for good. It is down by definition, so any worker action taken while it was failing, from the CLI or from the dashboard, dropped its declaration, and disarming those units at boot removed the accident that had been starting it. The list is a declaration, so it now follows the units on disk. A worker unit is written when the worker starts and removed when it stops, which makes its presence the honest record of what was asked for, and the running set is still consulted for stripe, the host proxy dev server and orphans, which have no unit the framework definition knows about. Closes #1627
The swap helper it borrowed lives in a linux-only test file, so the package failed to build for the macOS job while passing locally. The path under test is the same on both platforms, so the test carries its own.
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.
The workers list in a site's .lerd.yaml is what lerd start brings back, and it was rewritten after every worker action as the set of workers running at that moment. A worker that was merely down when an unrelated one was started or stopped was not in that snapshot and was written out of the file, and nothing put it back, so from then on it never started again.
That is how a crash-looping worker disappeared for good. It is down by definition, so any worker action taken while it was failing, from the CLI or from the dashboard, dropped its declaration, and disarming those units at boot removed the accident that had been starting it. It is the second half of what #1531 reported.
The list is a declaration, so it now follows the units on disk. A worker unit is written when the worker starts and removed when it stops, which makes its presence the honest record of what was asked for, and the running set is still consulted for stripe, the host proxy dev server and orphans, which have no unit the framework definition knows about.
Closes #1627
Refs #1531