Skip to content

plugins: fix cancel handling crash - #1642

Merged
BareosBot merged 15 commits into
bareos:bareos-23from
sebsura:backport/bareos-23/fix-cancel-handling-crash
Jan 5, 2024
Merged

BareosBot merged 15 commits into
bareos:bareos-23from
sebsura:backport/bareos-23/fix-cancel-handling-crash

Conversation

@sebsura

@sebsura sebsura commented Dec 22, 2023

Copy link
Copy Markdown
Contributor

Thank you for contributing to the Bareos Project!

Backport of PR #1595 to bareos-23

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
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
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@sebsura
sebsura force-pushed the backport/bareos-23/fix-cancel-handling-crash branch from 42c039c to b19597d Compare January 5, 2024 11:18
sebsura added 14 commits January 5, 2024 12:39
Each seperate thread needs its own python thread state to do things
inside of python.

(cherry picked from commit 6efcfe0)
The new test tries to cancel the job while the job is inside the
plugin module.  This is to check whether there are any crashes.

(cherry picked from commit e1f245c)
This allows us to test what happens if the plugin finishes the backup
while the cancelation is still ongoing.

(cherry picked from commit 3baa043)
This prevents the situation where one thread is still trying to cancel
something while another is already destroying parts of the jcr.

(cherry picked from commit 9f99ee3)
(cherry picked from commit 3e5432e)
(cherry picked from commit eadb837)
On windows one hase to use ::closesocket() instead of ::close() to
close sockets.  See: bsock_tcp.cc:50-58

(cherry picked from commit 91c1229)
(cherry picked from commit cb724e4)
@sebsura
sebsura force-pushed the backport/bareos-23/fix-cancel-handling-crash branch from b19597d to 838dae1 Compare January 5, 2024 11:40
@BareosBot
BareosBot merged commit b40879d into bareos:bareos-23 Jan 5, 2024
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.

3 participants