Skip to content

backup.cc: fail backup when Write Bootstrap to pipe fails#1296

Merged
pstorz merged 6 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/s5276-write-bootsrap-failed-pipe
Oct 31, 2022
Merged

backup.cc: fail backup when Write Bootstrap to pipe fails#1296
pstorz merged 6 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/s5276-write-bootsrap-failed-pipe

Conversation

@alaaeddineelamri
Copy link
Contributor

@alaaeddineelamri alaaeddineelamri commented Oct 27, 2022

Thank you for contributing to the Bareos Project!

When using a pipe in the Write Bootstrap directive, if the given command after the pipe fails, the job still is successful.
This PR checks for the return value of the pipe and makes the job fail in case of errors.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

General
  • PR name is meaningful
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
  • Is the PR title usable as CHANGELOG entry?
  • Separate commit for CHANGELOG.md ("update CHANGELOG.md"). The PR number is correct.
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
  • bareos-check-sources --since-merge does not report any problems

@pstorz pstorz self-requested a review October 27, 2022 13:17
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

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

See my comments. I did not understand completely the need for the changes for thread_list.cc.

Alaa Eddine Elamri added 3 commits October 28, 2022 19:42
in the PR that deprecated `Maximum Connections`, check for a maximum
number of threads were removed, and thread counts are no more capped.

However, the thread_list test was not correctly updated to reflect that,
so now we removed the expectation and removed the max connections
cap in the test
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5276-write-bootsrap-failed-pipe branch from 1c017be to ba99418 Compare October 28, 2022 17:42
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

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

I have updated the pipe error message in sync with e.g. fd_cmds.cc:732

Also answered to the comments on equal handling of the errors if the file cannot be opened.

@pstorz pstorz changed the title backup.cc: report error when piping in Write Bootstrap directive fails backup.cc: fail backup when Write Bootstrap to pipe fails Oct 31, 2022
@pstorz pstorz self-requested a review October 31, 2022 14:41
@pstorz pstorz merged commit 73c9573 into bareos:master Oct 31, 2022
@pstorz pstorz deleted the dev/alaaeddineelamri/master/s5276-write-bootsrap-failed-pipe branch October 31, 2022 14:41
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.

2 participants