Not treated exception EOFError

Bug #677409 reported by DarkAnthey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
txAMQP
Invalid
Undecided
Unassigned

Bug Description

Send a message and then try to create one createThriftClient. When using thamqp exception does not happen. But I can not continue to work with thrixt.

@defer.inlineCallbacks
def prepareClient(client, username, password):
    yield client.authenticate(username, password)

    channel = yield client.channel(1)
    yield channel.channel_open()

    def send_messages():
        content = 'Hello'
        msg = Content(content)
        msg["delivery mode"] = 2
        channel.basic_publish(exchange=servicesExchange, content=msg, routing_key=routingKey)
        print "Sending message: %s" % content
    send_messages()

    pfactory = TBinaryProtocol.TBinaryProtocolFactory()
    thriftClient = yield client.createThriftClient(responsesExchange, servicesExchange, routingKey, tournaments.Tournaments.Client, iprot_factory=pfactory, oprot_factory=pfactory)
    defer.returnValue(thriftClient)

FIX!!!
txamqp/contrib/thrift/protocol.py
line: 198. Fix to send message and after CreateThriftClient. Not treated exception EOFError.

        if oprot_factory is None:
            oprot = self.factory.oprot_factory.getProtocol(tr)
        else:
            oprot = oprot_factory.getProtocol(tr)

        try:
            d = processor.process(iprot, oprot)
        except TProtocolException, e:
            log.msg('TProtocolException: %s, message: %s, type:%s' % (e, e.message, e.type))
        except EOFError, e:
            log.msg('TProtocolException: %s' % e)

Changed in txamqp:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.