Prevent race condition on supervisorctl reload#2343
Merged
casperklein merged 2 commits intodocker-mailserver:masterfrom Dec 29, 2021
Merged
Prevent race condition on supervisorctl reload#2343casperklein merged 2 commits intodocker-mailserver:masterfrom
casperklein merged 2 commits intodocker-mailserver:masterfrom
Conversation
wernerfred
approved these changes
Dec 26, 2021
georglauterbach
approved these changes
Dec 26, 2021
Member
|
The more I think about it, and the more PRs out there are merged - especially considering the issue in #2348 - |
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.
Description
When setting
SUPERVISOR_LOGLEVELe.g. toinfo, supervisord will be restarted (don't get fooled by the term 'reload'):docker-mailserver/target/scripts/startup/setup-stack.sh
Lines 12 to 23 in 701037d
The restart however, can take some time. While this time period,
start-mailserver.shcontinues to run until terminated by supervisord. This can lead to errors, if files are modified (by our numerous sed-operations).When supervisord is completely restarted, also
start-mailserver.shis started again. Files that already have been modified by the first run, will now be reported as errors.This is how a problematic log looks like (empty lines added for readability):
1st part:
start-mailserver.shis running and restarts supervisord2nd part:
start-mailserver.shkeeps running for a bit3rd/4th part:
start-mailserver.shstarted again (see the 'Welcome to docker-mailserver 10.4.0' message). Notice the sed errors, because sed was run a second time.To prevent this,
start-mailserver.shshould exit after callingsupervisorctl reload.After applying this fix, the log looks like this:
Fixes #
Type of change
Checklist:
docs/)