Skip to content

jcr: fix some compiler warnings#1648

Merged
BareosBot merged 13 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-find-if-compiler-warning
Feb 21, 2024
Merged

jcr: fix some compiler warnings#1648
BareosBot merged 13 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-find-if-compiler-warning

Conversation

@sebsura
Copy link
Contributor

@sebsura sebsura commented Jan 2, 2024

Thank you for contributing to the Bareos Project!

This PR fixes some compiler warnings related to std::find_if() now being marked as [[nodiscard]].
It also fixes some race conditions.
It also makes every daemon send a jobmessage with its version at the start of each job.
Additionally it adds tls kernel module detection the the ktls test. Now the test gets skipped if the module is not loaded.

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)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
    Check backport line
    Required backport PRs have been created
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

@sebsura sebsura force-pushed the dev/ssura/master/fix-find-if-compiler-warning branch 2 times, most recently from f9b6cbe to 0304ad5 Compare January 2, 2024 13:48
@pstorz pstorz self-requested a review January 4, 2024 10:42
@pstorz pstorz self-assigned this Jan 4, 2024
@sebsura sebsura force-pushed the dev/ssura/master/fix-find-if-compiler-warning branch 2 times, most recently from e62ede5 to 0cfa26d Compare January 17, 2024 07:15
@sebsura sebsura force-pushed the dev/ssura/master/fix-find-if-compiler-warning branch 2 times, most recently from cfbff62 to 755af3c Compare February 5, 2024 13:55
@sebsura sebsura force-pushed the dev/ssura/master/fix-find-if-compiler-warning branch 3 times, most recently from ec27b00 to d7345f3 Compare February 19, 2024 08:44
@sebsura sebsura force-pushed the dev/ssura/master/fix-find-if-compiler-warning branch from d7345f3 to d9a1b29 Compare February 21, 2024 05:40
sebsura and others added 13 commits February 21, 2024 12:39
Sadly on the fd side there is no easy way to do it for each job
automatically.  At the moment I added it manually to backup and
restore jobs.  We will see if we want to add them somewhere else as
well.
The test was comparing the number of files that the fd send to the
sd (this is the number displayed in the backup summary) to the number
of files that get restored (which is equal to the number of files that
the sd sends to the director).  This of course does not make sense and
can cause problems if the cancel does not happen fast enough.  Since
in that case the fd might continue sending files to the sd with the sd
never having the chance to send those to the director.

The fix is simple: we need to check the backup log and add up all
checkpoint batch inserts instead.  This should be equal to the number
of files that the sd send to the director.

For easier debugging I also added tracing to the test.
Depending on where your source code is located, the regex replace may
remove more than just the path prefix that we want to
replace (e.g. source is located at /bareos -> bad replace for
etc/bareos/...).

Now ALL_FILES contains paths relative to CMAKE_SOURCE_DIR (that way we
do not need to remove it anymore).  To restore the previous behaviour
we now just need to prepend the source directory again to get the
CURRENT_FILE.
Trying to connect to a dead deamon takes around 15 secs, so doing it
20 times takes around 15 * 20 = 300 secs.  Which means the test will
time out, which is not very helpful.  Now the test tries to wait for
only the amount of time it was given (+- one extra attempt).
@BareosBot BareosBot force-pushed the dev/ssura/master/fix-find-if-compiler-warning branch from 3ede91e to 6ad7644 Compare February 21, 2024 12:39
@BareosBot BareosBot merged commit d2a8706 into bareos:master Feb 21, 2024
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.

3 participants