unhandled exception in mqtt.py , puback method #572
Unanswered
RoccoCloudCycle
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I'm of two minds here.
We could swallow these exceptions internally I suppose. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
in mqtt.py, if Connetcion.publish() is called and then the associated future is cancelled, the method will still process the response which will raise an exception:
def puback(packet_id, error_code): if error_code != 0: future.set_exception(awscrt.exceptions.from_code(error_code)) else: future.set_result(dict(packet_id=packet_id))
def set_result(self, result): with self._condition: if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}: raise InvalidStateError('{}: {!r}'.format(self._state, self)) .....
at runtime I get the following message:
Exception ignored in: <class 'concurrent.futures._base.InvalidStateError'> Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/awscrt/mqtt.py", line 810, in puback future.set_result(dict(packet_id=packet_id)) File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 544, in set_result raise InvalidStateError('{}: {!r}'.format(self._state, self)) concurrent.futures._base.InvalidStateError: CANCELLED: <Future at 0xffff74199210 state=cancelled>
why the exception is not handled? should the error_code be set when the futures is cancelled?
Regards,
Rocco
Beta Was this translation helpful? Give feedback.
All reactions