Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve manager during updates and fix deadlock during restart before full start #193

Merged
merged 5 commits into from
Jul 24, 2020

Conversation

frikilax
Copy link
Member

@frikilax frikilax commented Jul 22, 2020

✨ Improve manager during updates and fix deadlock during restart before full start

‼️ Once all the checklist is done you have to:

  • stash merge this pull request
  • delete the corresponding branch
  • close the associated issue

📃 Type of change

Please delete options that are not relevant.

Bug fix: non-breaking change which fixes an issue.
New feature: non-breaking change which adds functionality.

💡 Related Issue(s)

✒️ Description

Some improvements have been made in this PR:

Update

  • when issuing a "update_filters" command with an empty "filters" or none at all, the manager will make a diff of current and newly configured filters in its conf, and start/stop filters according to this diff.
  • filters updated in conf won't be taken into account, only filters deleted/added will be taken into account

Fixes

  • send a response to client when command has a JSON parsing error
  • remove unused restart_all() method
  • remove lock on start_all()/stop_all() functions, preventing deadlock
    • those functions are called before/after other threads are active, so locking is useless
  • avoid manager raising when starting a wrong filter during update

🎯 Test Environments

HBSD (12.1)

  • Python (3.7.7)

Ubuntu (18.04)

  • Python (3.6.9)

✔️ Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • (If other changes) I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

  • 🙋 I certify on my honor that all the information provided is true, and I've done all I can to deliver a high quality code

frikilax added 3 commits July 22, 2020 09:53
- manager can start/stop filters based on list diff
  -> when sending 'update_filters' command without filters' list, the manager will find deleted and added filters and start/stop them
  -> the manager still won't find updated filters' configuration, user should still provide an explicit list to restart updated filters
- added tests to prove feature is working
@frikilax frikilax added bug Something isn't working enhancement New feature or request technical labels Jul 22, 2020
@frikilax frikilax added this to the Version 1.3 milestone Jul 22, 2020
@frikilax frikilax self-assigned this Jul 22, 2020
send a list 'errors' when a JSON decoding error is catched
HugoSoszynski
HugoSoszynski previously approved these changes Jul 24, 2020
avoid manager raising and failing when, during an update of filters, one filter to start has a wrong path or an invalid executable
@frikilax frikilax merged commit df49584 into dev Jul 24, 2020
@frikilax frikilax deleted the manager_fix branch July 24, 2020 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request technical
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants