[ 
https://issues.apache.org/jira/browse/QPID-7053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15139850#comment-15139850
 ] 

Brian Bouterse commented on QPID-7053:
--------------------------------------

I'm not totally sure why it didn't work, but I tried hard to have it work that 
way. The thing I wrote bugs me with duplicated methods.

Along the way I did interesting/horrible related thing. Endpoint, Connection, 
Session, and Sender are all old-style Python classes. Receiver is a new-style 
Python class which is done using a mixin. As such the __setattr__ 
implementation needed to be different. So at a minimum you'll have to have two 
__setattr__ implementations. If you try to have Receiver use the new-style 
__setattr__ appropriate implementation it never receives messages.

I made a version which had the two new methods defined on Endpoint, both 
written for the old-style class functionality. I also added a __setattr__ onto 
Receiver that worked with a new-style class. This should have worked, but it 
also would not receive any messages. I believe the problem is related to the 
fact that object is used as a mixin which is just bad. Notice that when I say 
"it doesn't work" I mean it doesn't receive messages, and observe that Receiver 
is the one that is new-style via mixin (which seems very wrong).

As an aside, the __init__ methods never call their parent which is also not 
correct, but it prevents adding an __init__ on Endpoint. I recommend updating 
all qpid.messaging objects to be new-style classes and check the inheritance to 
ensure super() is used to call the parent defined behavior. I actually have a 
list of all the other issues I found while I was in there which haven't been 
discussed here.

> Exception Notifier Callback
> ---------------------------
>
>                 Key: QPID-7053
>                 URL: https://issues.apache.org/jira/browse/QPID-7053
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Python Client
>    Affects Versions: 0.32
>            Reporter: Brian Bouterse
>
> When making effective use of the message_received callback handler added with 
> QPID-5799, an unintended side-effect occurs regarding exception handling.
> The user registers the message_recieved callback using 
> set_message_received_handler and then only calls back into qpid.messaging 
> when it was told to do so. As a result when a ConnectionError occurs it is 
> not raised. This effectively deadlocks the receiver since it can't know to 
> call into qpid.messaging.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to