Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Fix thread termination behavior for Python <= 3.7.3 #69

Merged
merged 2 commits into from
Nov 23, 2020

Conversation

0snap
Copy link
Contributor

@0snap 0snap commented Nov 23, 2020

📔 Description

This PR fixes a bug that was introduced with #61

This bug caused Threat Bus to terminate directly after startup in Python 3.7.3 and earlier. A detailed description of the issue can be found in this Stackoverflow post.

📝 Checklist

  • All user-facing changes have changelog entries.
    Not needed: This fixes an unreleased bug and a Changelog entry for the desired behavior already exists.
  • The changes are reflected on docs.tenzir.com/threatbus, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.

🎯 Review Instructions

Commit-by-commit

Test this as follows:

  • you need two Python installations, 3.7 <= Python <= 3.7.3 and Python >= 3.7.4
  • two virtualenvs
  • run make dev-mode in both envs
  • craft a config that activates all plugins, see config.yaml.example
  • start Threat Bus: venv/bin/threatbus -c config.yaml in each env (one at a time, else they try to use the same ports)
  • wait a sec. it should keep running and not terminate on its own. send a few messages if you like.
  • terminate it via ctrl+c
  • it should gracefully stop all plugins, independent on the used Python version.

@0snap 0snap requested a review from mavam November 23, 2020 12:58
@0snap 0snap added the bug Incorrect behavior label Nov 23, 2020
@0snap
Copy link
Contributor Author

0snap commented Nov 23, 2020

@satta This PR makes Threat Bus work with Python 3.7.3, the default Python version installed with Debian Buster.

@0snap 0snap changed the title Story/ch2521/threads for python 3.7.3 Fix thread termination behavior for Python <= 3.7.3 Nov 23, 2020
@satta
Copy link
Contributor

satta commented Nov 23, 2020

Very nice, thanks!

Copy link
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

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

I did not run these, but if someone can confirm that these work, this can be merged.

Just to be clear: I'm green-lighting the functionality that stop and join can only be called if the thread is alive.

@0snap 0snap merged commit fa1ab06 into master Nov 23, 2020
@0snap 0snap deleted the story/ch2521/threads-for-python-3.7.3 branch November 23, 2020 13:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants