Bugfix: Proper async_call error/exception handling#65
Merged
elbakramer merged 2 commits intoelbakramer:masterfrom Mar 23, 2022
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #65 +/- ##
=========================================
- Coverage 6.33% 6.32% -0.01%
=========================================
Files 203 203
Lines 12812 12821 +9
=========================================
Hits 811 811
- Misses 12001 12010 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
async_call error/exception handlingasync_call error/exception handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
QRateLimitedExecutor wrapping functions like
RateLimitedCommRqData,RateLimitedCommKwRqData,RateLimitedSendOrder,RateLimitedSendConditionreturnconcurrent.futures.Futureobject immediately upon asynchronous execution withasync_call.Therefore, the result after execution should be returned by attaching callback functions 1, 2 to the Future object. However, the callback implementation contained in
try_or_raisecurrently does not have a way to properly handle an error or an exception in the function return.For example, if an error or exception occurs between immediately after the execution of a function and before the event begins to return, there is no way on the server side to notify the client that there is an error, and the client will continue to wait for the next message. I found this attempt, but this is an invalid exception handling method for
async_callreturning a Future object.In this pull request, the
except_callbackargument to receive the exception object when an error or exception occurs was added totry_or_raise, and I tried to find a place where it can be used and apply it all.