Skip to content

Fix context issue in bareos-dir python plugin#1047

Merged
arogge merged 3 commits intobareos:masterfrom
arogge:dev/arogge/master/fix-python-dir
Feb 18, 2022
Merged

Fix context issue in bareos-dir python plugin#1047
arogge merged 3 commits intobareos:masterfrom
arogge:dev/arogge/master/fix-python-dir

Conversation

@arogge
Copy link
Member

@arogge arogge commented Jan 17, 2022

This PR adds a test that exposes a bug in python-dir's context handling and provides an appropriate fix.

Thank you for contributing to the Bareos Project!

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
  • Separate commit for this PR in the CHANGELOG.md, PR number referenced is same
  • Commit descriptions are understandable and well formatted
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
  • git status should not report modifications in the source tree after building and testing
Tests
  • Decision taken that a system- or unittest is required (if not, then remove this paragraph)
  • The decision towards a systemtest is reasonable compared to a unittest
  • Testname matches exactly what is being tested
  • Output of the test leads quickly to the origin of the fault

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.

Good work!

@pstorz pstorz self-requested a review February 4, 2022 11:18
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.

Very good work!
Only the CHANGELOG.md entry is missing.

@arogge arogge force-pushed the dev/arogge/master/fix-python-dir branch from 3c1b118 to e7948da Compare February 8, 2022 19:26
@arogge arogge requested a review from pstorz February 8, 2022 19:26
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.

Good work! Thank you!

Previously when running multiple jobs concurrently, the python plugin
would not always set the right context before running the python
callback function.
This patch makes the context thread_local and resets it before every
callback.
This patch lets the test run multiple jobs in parallel and checks that
each plugin callback sees the correct plugin context.
@arogge arogge force-pushed the dev/arogge/master/fix-python-dir branch from e7948da to 1f2263b Compare February 18, 2022 14:35
@arogge arogge force-pushed the dev/arogge/master/fix-python-dir branch from 1f2263b to c3557d0 Compare February 18, 2022 14:40
@arogge arogge merged commit a2cf56b into bareos:master Feb 18, 2022
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.

2 participants