Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle malformed or empty config_changes.queue file #913

Merged
merged 2 commits into from
Mar 21, 2024
Merged

Conversation

gcalacoci
Copy link
Contributor

If for whatever reason (ie: invalid JSON content or empty queue file)
The JSON parser throws an exception, emits a warning and continues with an
empty list

References: BAR-151

If for whatever reason (ie: invalid JSON content or empty queue file)
The JSON parser throws an exception, emits a warning and continues with an
empty list

References: BAR-151

Signed-off-by: Giulio Calacoci <giulio.calacoci@enterprisedb.com>
Signed-off-by: Giulio Calacoci <giulio.calacoci@enterprisedb.com>
Copy link
Contributor

@barthisrael barthisrael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. They even bring a self-healing mechanism which throws a WARNING just once, and fixes the issue:

$ barman cron
Starting WAL archiving for server pg

$ echo "" > barman_home/cfg_changes.queue

$ barman cron
WARNING: Malformed or empty configuration change queue: /home/vagrant/barman_home/cfg_changes.queue
Starting WAL archiving for server pg

$ barman cron
Starting WAL archiving for server pg

$ cat barman_home/cfg_changes.queue
[]

@gcalacoci gcalacoci merged commit 2bb5556 into master Mar 21, 2024
7 of 8 checks passed
@gcalacoci gcalacoci deleted the dev/bar-151 branch March 21, 2024 12:01
@martinmarques
Copy link
Contributor

I know this is closed, but shouldn't we emit an output message as a warning when the queue file is not found?

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.

None yet

3 participants