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

Error properly on startup #8121

Merged
merged 4 commits into from May 27, 2021
Merged

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented May 27, 2021

Summary

  • Resolves a regression caused by Remove cherrypy dependency #8026 whereby errors occurring during plugin life cycle events would then cause an error in their handling.
  • Does this by letting the handler function take arbitrary *args, to match the signature of the magicbus error state handlers: https://github.com/cherrypy/magicbus/blob/main/magicbus/process.py#L101
  • Simplifies service shutdown by only makes the call to shutdown the worker threads once, and makes it blocking
  • Adds a handle_SIGINT method to give different logging when a SIGINT signal is called versus SIGTERM

References

Fixes #8119

Reviewer guidance

Make sure Kolibri starts up properly and then reacts properly to CTRL-C, or throwing any error during a call to register the zero conf service, or start one of the worker threads.

Noting that I have observed recently that a command prompt will display and then further logging text will happen after the CTRL-C - I am at a loss to work out how to prevent this, as the way that magicbus handles signal handlers is the way that every StackOverflow post recommends to try to handle this, so I am at a loss as to how to resolve it.


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@rtibbles rtibbles added the TODO: needs review Waiting for review label May 27, 2021
@rtibbles rtibbles added this to the 0.15.0 milestone May 27, 2021
@rtibbles rtibbles requested a review from jredrejo May 27, 2021 14:28
Copy link
Member

@jredrejo jredrejo left a comment

Choose a reason for hiding this comment

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

Tested without issues, and code LGTM

@jonboiser jonboiser removed the TODO: needs review Waiting for review label May 27, 2021
@jonboiser jonboiser merged commit 5659816 into learningequality:develop May 27, 2021
@rtibbles rtibbles deleted the error_properly branch May 27, 2021 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kolibri fails to handle errors during startup and instead, itself errors
3 participants