Refactor config reloading by using shared pointers instead of callbacks#1151
Merged
Refactor config reloading by using shared pointers instead of callbacks#1151
Conversation
12 tasks
a8d7fb4 to
31b4e2c
Compare
polz113
pushed a commit
to polz113/bareos
that referenced
this pull request
May 3, 2022
In order to quickly identify which volumes are available by your autochanger an additional column is introduced on volume tables. Fixes bareos#1151: bareos webui does not show the inchanger flag for volumes
arogge
reviewed
Jun 13, 2022
pstorz
commented
Jul 21, 2022
Member
Author
pstorz
left a comment
There was a problem hiding this comment.
Looks good to me. Good work!
f24dc6d to
bd91589
Compare
alaaeddineelamri
approved these changes
Aug 1, 2022
aebcb81 to
8dc329d
Compare
13 tasks
Remove the indexes of the resource tables for each daemons by starting all enums at 0 instead of a individual startnumber. That makes access much easier as we do not need R_FIRST and R_LAST anymore.
Co-authored-by: Andreas Rogge <andreas.rogge@bareos.com>
Co-authored-by: Andreas Rogge <andreas.rogge@bareos.com>
Co-authored-by: Andreas Rogge <andreas.rogge@bareos.com>
Co-authored-by: Andreas Rogge <andreas.rogge@bareos.com>
Calling my_config->BackupResourceTable() avoids memleaks if a new config is parsed while another already exists.
partial revert of commit 2ca777e
c4a12e8 to
f96a0b5
Compare
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.
The original way of handling the reload mechanism used callbacks that were registerd on every job start with internal job counters that would free the used configuration resources when no job is using it anymore.
Now the new mechanism simply uses shared pointers that own the configuration resources. On every job start, each job becomes shared owner of the resources, and on successfull reload the prevous confiugration resources are released by the director itself, so that only currently using jobs own the resource. When the last job using the configuration resources ends the resources are automatically freed.
The definitions of resources have been simplified by starting the resource definitons now with
0in all daemons instead of having a number for start and end.In addition, the formerly used static global definitions of the resources now have been converted to be dynamic.
Thank you for contributing to the Bareos Project!
Please check
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
- [ ] If backport: add original PR number and target branch at top of this file: Backport of PR#000 to bareos-2xSource code quality
bareos-check-sources --since-mergedoes not report any problemsgit statusshould not report modifications in the source tree after building and testingTests