Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ack with error protobuf object, (ACK 的包写错了对象) #11

Open
siriuscc opened this issue Dec 31, 2019 · 2 comments
Open

ack with error protobuf object, (ACK 的包写错了对象) #11

siriuscc opened this issue Dec 31, 2019 · 2 comments

Comments

@siriuscc
Copy link

源代码:https://github.com/haozi3156666/canal-python/blob/68ecec0795ef712c0c00d001fccb39215cfbc3dc/canal/client.py#L116

        elif packet.type == CanalProtocol_pb2.PacketType.ACK:
            ack = CanalProtocol_pb2.PacketType.Ack()
            ack.MergeFromString(packet.body)
            if ack.error_code > 0:
                raise Exception('get data error. error code:%s, error message:%s' % (ack.error_code, ack.error_message))

CanalProtocol_pb2.PacketType.Ack()是一个枚举?即使是枚举也不能这么写吧。此处ACK回包,应该是返回 CanalProtocol_pb2.Ack()

        elif packet.type == CanalProtocol_pb2.PacketType.ACK:
            ack = CanalProtocol_pb2.Ack()
            ack.MergeFromString(packet.body)
            if ack.error_code > 0:
                raise Exception('get data error. error code:%s, error message:%s' % (ack.error_code, ack.error_message))

否则,运行有可能报错,至于为何不是必现的错误,我也不解,不知是否是bytes流的问题。

@xingfeT
Copy link

xingfeT commented Oct 10, 2020

我也有这样的问题。 你已经改了吗

@ttgml
Copy link

ttgml commented Nov 30, 2022

这个是个必现的错误,当使用get_without_ack时,数据库里面一次执行两次update,这个时候就会报错。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants