bareos: master 9a3d85f2

Author Committer Branch Timestamp Parent
Marco van Wieringen Marco van Wieringen master 2016-01-06 16:50 master 2fd2273c Pending
Changeset dird: Remove fixed size reload table.

The current reload logic is really to complex and to limited for any
piece of software in 2016. This patch makes things seriously less
complex and also removes all kind of limitations. From a design
standpoint its certainly not an endpoint it would be better if we
would either have proper reference counting to the resources so we
actually know what is still referenced by any running Job on reload
or that we before calling job_end_push() try updating the dangling
pointers in the JCR to the old config to point to the new config and
only call job_end_push() when we are referencing resources that are no
longer available in the new config. If we succeed in updating all
pointers we are not referencing the old structures anymore and if we
succeed in doing that for all JCRs we can drop the old config and don't
need to keep it lingering around anymore.

For now this changes the following:
- Use proper structure to store the callback function and context
  and not push two items on the cleanup stack.
- We use a set of two simple local variables that contain the previous
  config and eventually a failed config, only when we are having any
  Jobs running we do the hard work of allocating a more permanent
  structure and pushing the cleanup routine and used context for a later
  cleanup when the actual Job finishes. So when there is nothing running
  the code path is rather straight forward.
mod - src/dird/dird.c Diff File
mod - src/include/jcr.h Diff File
mod - src/lib/jcr.c Diff File