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

Fix for unexpected termination of worker threads #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

E-Heerschap
Copy link

Problem:
When the task(*args, **kwargs) call was a valid function (not None) but had a TypeError it would cause the thread to terminate. This had caused gateway configs timeout on gateways that had in-fact responded in time. The unexpected exit on a TypeError without any logging made it very difficult to find the fault.

This change instead explicitly checks if the task is None prior to terminating. Otherwise, any errors that occur will be logged using logging.exception but the thread itself will continue processing work. This stops any unexpected terminations of worker threads if a TypeError occurs during processing.

I've used the catch all Exception since I'd think most people would like things to continue processing if an error occurs on one job and can try except exit themselves if they would like things to stop. However, completely understand if you have a different opinion and would do away with it.

Cheers,
Edwin

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.

2 participants