Skip to content

cats: fix missing locks#2331

Merged
BareosBot merged 16 commits intobareos:masterfrom
sebsura:dev/master/ssura/fix-db-crash
Sep 30, 2025
Merged

cats: fix missing locks#2331
BareosBot merged 16 commits intobareos:masterfrom
sebsura:dev/master/ssura/fix-db-crash

Conversation

@sebsura
Copy link
Contributor

@sebsura sebsura commented Jul 24, 2025

Thank you for contributing to the Bareos Project!

This pr fixes issue #2312. I added the missing locks and also removed the builtin crash from the ownership check. As the director going down is a pretty major issue, it should not happen if only some error messages get potentially misread.

This also fixes issue #2336 ...

We added also a fix for subscription view to better classified filer units, reported by customer with support.

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
  • Required backport PRs have been created
  • Correct milestone is set
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 self-assigned this Jul 24, 2025
@sebsura sebsura added this to the 25.0.0 milestone Jul 24, 2025
@bruno-at-bareos bruno-at-bareos linked an issue Jul 24, 2025 that may be closed by this pull request
@sebsura sebsura force-pushed the dev/master/ssura/fix-db-crash branch from 367aef0 to b7205fc Compare July 24, 2025 11:29
@sebsura sebsura force-pushed the dev/master/ssura/fix-db-crash branch from b7205fc to 7a0a189 Compare August 6, 2025 05:24
@sebsura sebsura linked an issue Aug 6, 2025 that may be closed by this pull request
@sebsura sebsura force-pushed the dev/master/ssura/fix-db-crash branch 8 times, most recently from 38b32ea to 6970890 Compare August 8, 2025 06:47
@sebsura sebsura force-pushed the dev/master/ssura/fix-db-crash branch from 16ebc26 to 941ad80 Compare August 21, 2025 11:02
@sebsura sebsura requested a review from arogge August 22, 2025 06:34
@arogge
Copy link
Member

arogge commented Sep 2, 2025

We should avoid the double-lock on batch-inserts, especially as the error retrieval we added a lock for doesn't work when batch-insert is used.

Copy link
Member

@arogge arogge 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 a few minor comments.

Copy link
Member

@arogge arogge left a comment

Choose a reason for hiding this comment

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

Sorry, I have one final thing...

@sebsura sebsura force-pushed the dev/master/ssura/fix-db-crash branch 6 times, most recently from ca985c1 to 0667968 Compare September 25, 2025 09:23
@sebsura sebsura force-pushed the dev/master/ssura/fix-db-crash branch 2 times, most recently from d7ca667 to 5f73629 Compare September 25, 2025 12:16
@sebsura sebsura mentioned this pull request Sep 25, 2025
7 tasks
Copy link
Member

@arogge arogge left a comment

Choose a reason for hiding this comment

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

This looks good. Thank you!

@arogge
Copy link
Member

arogge commented Sep 26, 2025

Are you actually going to backport this down into 23?

Most of the time the lock issue only results in bad error messages.
Killing the bareos director for this is probably not the right
idea. So for now its being downgraded to just being logged.
This test randomly generates commands and sends them to the director.
This is done to make sure that commands do not crash the director for
no reason.
This causes weird issues when StripPath is used as it is not able to
properly strip paths not ending in `/` now.  This may also solve other
problems.
@sebsura sebsura force-pushed the dev/master/ssura/fix-db-crash branch from 5f73629 to 53cdc75 Compare September 29, 2025 08:54
@sebsura
Copy link
Contributor Author

sebsura commented Sep 29, 2025

No. The fixes are not applicable to 23.

sebsura and others added 6 commits September 30, 2025 15:41
Previously we could leave the GetFileList() call without adding any
files to the bsr.  This would cause the bsr jobid to stay at 0 and
AddVolumeInformationToBsr would then print a very cryptic error
message (as it didnt know it should look for a specific jobid, but
instead search for the (unset) job name).

This fixes this by making sure we exit early if we detect that no file
was inserted into the bsr.
Due to a missing % in the meta searched pattern, filer classification
was incomplete.

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
@sebsura sebsura force-pushed the dev/master/ssura/fix-db-crash branch from 53cdc75 to a5aa8f3 Compare September 30, 2025 13:41
@BareosBot BareosBot merged commit 83e557c into bareos:master Sep 30, 2025
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate error with "empty" incrementals with strip Update job command crashes director when jobid doesn't exist

4 participants