Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The entire code of the controller and the workers leverage on asyncio tasks.
In the current version of the code, if one of the task was raising an exception, we fail right away and re-raise the exception letting the core method of the SuzieQ components handle the exception.
It may happen that more than one task raise an exception: in this case, since we raise an exception as soon as we see one, the other exceptions are not handled.
For these exceptions, asyncio complains with the message
Task exception was never retrieved
(see python docs) and re-raise the exceptions, but since the main code of the SuzieQ component is already ended, the exception is not handled and the traceback is printed on the log generating a confusing output.To fix this issue, it is introduced a new exception class called
SqRuntimeError
which contains a list of exceptions.In the code of the controller and the worker, instead of raising the exception as soon as we see a task failing, we collect all the exception in an array. If this array is not empty, we use this array to initialize a
SqRuntimeError
exception and we raise this exception.The main code of the controller (sq_poller.py) and the worker (sq_worker.py) will verify if the type of the exception is
SqRuntimeError
and if so, log each exception in the exception list.Type of change
Double Check
develop
branch.develop
branch.--signoff
applied