Skip to content

断网状态下,stream读取数据超时会连续报错两次,导致keepalive方法会连续调用两次,其中一个setInterval就永远不会被clear #196

@suitongxian

Description

@suitongxian

断网状态下,stream会连续收到两次error事件,内容为“14 UNAVAILABLE: read ETIMEDOUT”,这个错误会触发连续两次handleKeepaliveError方法的调用,而handleKeepaliveError中对keepalive()的调用使用了setTimeout,所以就会连续两次调用keepalive()方法,导致teardown变量的值被最后一次调用覆盖,那么第一次调用中生成的setInterval就永远不会被清除,稳定复现,
复现操作是创建成功租约后,把网线断开观察即可

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions