wechaty/puppet-service

grpc服务端未启动成功时,没有断线重连。

su-chang opened this issue · 1 comments

随意指定一个endpoint 即可复现

Code

new Wechaty({
    puppet: 'wechaty-puppet-service',
    puppetOptions: {
      token,
      endpoint: 'xxx.xx.xx.xxx:xxxx',
    }
  })

Log

21:10:36 VERB Wechaty initPuppet() wechaty-puppet-service
21:10:36 VERB MemoryCard multiplex(puppet)
21:10:36 VERB MemoryCard static multiplex(MemoryCard<>, puppet)
21:10:36 VERB MemoryCard constructor({"multiplex":{"name":"puppet","parent":{"payload":{},"multiplexNameList":[]}}})
21:10:36 VERB PuppetManager resolve({puppet: wechaty-puppet-service, puppetOptions: {"token":"puppet_wxwork_0e91401a981a941b","endpoint":"52.81.15.65:16832"}})
21:10:36 VERB PuppetManager resolveName(wechaty-puppet-service)
21:10:36 VERB PuppetManager checkModule(wechaty-puppet-service)
21:10:36 SILL PuppetManager checkModule() wechaty-puppet-service installed version 0.21.10 satisfied range >=0.21
21:10:36 VERB Puppet constructor({"token":"puppet_wxwork_0e91401a981a941b","endpoint":"52.81.15.65:16832"}) #0
21:10:36 VERB StateSwitch constructor(PuppetService, "{"log":{"enableTimestamp":true,"logLevel":5,"prefixFilter":{}}}")
21:10:36 VERB MemoryCard constructor(undefined)
21:10:36 VERB MemoryCard getStorage() for storage type: N/A
21:10:36 VERB MemoryCard load() from storage: N/A
21:10:36 VERB MemoryCard load() no storage
21:10:36 VERB Puppet constructor() watchdog timeout set to 60 seconds
21:10:36 VERB HotImport callerResolve(., /Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/wechaty-puppet/dist/src/puppet.js)
21:10:36 SILL HotImport callerResolve() callsites() file=/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/hot-import/dist/src/hot-import.js, type=Object
21:10:36 SILL HotImport callerResolve() callsites() file=/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/wechaty-puppet/dist/src/puppet.js, type=null
21:10:36 SILL HotImport callerResolve() callsites() file=/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/wechaty-puppet-service/dist/src/client/puppet-service.js, type=null
21:10:36 SILL HotImport callerResolve() callerFile=/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/wechaty-puppet-service/dist/src/client/puppet-service.js
21:10:36 VERB Puppet constructor() childClassPath=/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/wechaty-puppet-service/dist/src/client
21:10:36 VERB Puppet setMemory()
21:10:36 VERB Wechaty initPuppetEventBridge(Puppet#0<PuppetService>())
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(friendship) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(login) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(logout) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(message) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(room-invite) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(room-join) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(room-leave) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(room-topic) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(scan) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(dirty) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(dong) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(error) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(heartbeat) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(ready) (listenerCount:0) registering...
21:10:36 VERB Wechaty initPuppetEventBridge() puppet.on(reset) (listenerCount:0) registering...
21:10:36 VERB Wechaty wechatifyUserModules(Puppet#0<PuppetService>())
21:10:36 VERB PuppetService start()
21:10:36 SILL StateSwitch <PuppetService> on() is false
21:10:36 SILL StateSwitch <PuppetService> on() is false
21:10:36 VERB StateSwitch <PuppetService> on(pending) <- (false)
21:10:36 VERB PuppetService startGrpcClient()
21:10:36 VERB PuppetService startGrpcStream()
21:10:36 VERB PuppetService startClient()
21:10:36 VERB PuppetService startGrpcStream() eventStream.on(error) Error: 14 UNAVAILABLE: No connection established
21:10:36 SILL Puppet throttleReset() payload: "{"data":"startGrpcStream() eventStream.on(error) Error: 14 UNAVAILABLE: No connection established"}"
21:10:36 SILL Puppet constructor() resetThrottleQueue.subscribe() reason: "startGrpcStream() eventStream.on(error) Error: 14 UNAVAILABLE: No connection established"
21:10:36 VERB Puppet reset(startGrpcStream() eventStream.on(error) Error: 14 UNAVAILABLE: No connection established)
21:10:36 VERB PuppetService startGrpcStream() eventStream.on(end)
21:10:36 VERB PuppetService stop()
21:10:36 SILL StateSwitch <PuppetService> off() is false
21:10:36 SILL StateSwitch <PuppetService> off() is false
21:10:36 VERB StateSwitch <PuppetService> off(pending) <- (false)
21:10:36 VERB PuppetService stopGrpcStream()
21:10:36 ERR PuppetService start() rejection: 14 UNAVAILABLE: No connection established
Error: 14 UNAVAILABLE: No connection established
    at Object.callErrorFromStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/call.ts:81:24)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client.ts:338:36)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client-interceptors.ts:426:34)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client-interceptors.ts:389:48)
    at /Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/call-stream.ts:276:24
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
21:10:36 SILL StateSwitch <PuppetService> off() is pending
21:10:36 VERB StateSwitch <PuppetService> off(true) <- (pending)
Error: 14 UNAVAILABLE: No connection established
    at Object.callErrorFromStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/call.ts:81:24)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client.ts:338:36)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client-interceptors.ts:426:34)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client-interceptors.ts:389:48)
    at /Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/call-stream.ts:276:24
    at processTicksAndRejections (internal/process/task_queues.js:77:11) {
  code: 14,
  details: 'No connection established',
  metadata: Metadata { internalRepr: Map(0) {}, options: {} }
}
21:10:36 ERR Wechaty start() exception: 14 UNAVAILABLE: No connection established
==========error==========
Error: 14 UNAVAILABLE: No connection established
21:10:36 VERB Wechaty <wechaty-puppet-service> stop() v0.62.3 is stopping ...
21:10:36 SILL StateSwitch <Wechaty> off() is false
21:10:36 SILL StateSwitch <WechatyReady> off() is true
21:10:36 VERB StateSwitch <WechatyReady> off(true) <- (true)
21:10:36 SILL StateSwitch <Wechaty> off() is false
21:10:36 VERB StateSwitch <Wechaty> off(pending) <- (false)
21:10:36 VERB PuppetService stop()
21:10:36 SILL StateSwitch <PuppetService> off() is true
21:10:36 WARN PuppetService stop() is called on a OFF puppet. await ready(off) and return.
21:10:36 VERB StateSwitch <PuppetService> ready(off, false)
21:10:36 SILL StateSwitch <PuppetService> ready(off, false) resolved.
21:10:36 SILL StateSwitch <Wechaty> off() is pending
21:10:36 VERB StateSwitch <Wechaty> off(true) <- (pending)
21:10:36 ERR PuppetService stop() stop GRPC rejection: 14 UNAVAILABLE: No connection established
21:10:36 SILL StateSwitch <PuppetService> off() is true
21:10:36 VERB StateSwitch <PuppetService> off(true) <- (true)
21:10:36 VERB PuppetService start()
21:10:36 SILL StateSwitch <PuppetService> on() is false
21:10:36 SILL StateSwitch <PuppetService> on() is false
21:10:36 VERB StateSwitch <PuppetService> on(pending) <- (false)
21:10:36 VERB PuppetService startGrpcClient()
21:10:36 VERB PuppetService startGrpcStream()
21:10:36 VERB PuppetService startClient()
21:10:36 VERB PuppetService startGrpcStream() eventStream.on(error) Error: 14 UNAVAILABLE: No connection established
21:10:36 SILL Puppet throttleReset() payload: "{"data":"startGrpcStream() eventStream.on(error) Error: 14 UNAVAILABLE: No connection established"}"
21:10:36 VERB PuppetService startGrpcStream() eventStream.on(end)
21:10:36 ERR PuppetService start() rejection: 14 UNAVAILABLE: No connection established
Error: 14 UNAVAILABLE: No connection established
    at Object.callErrorFromStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/call.ts:81:24)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client.ts:338:36)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client-interceptors.ts:426:34)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client-interceptors.ts:389:48)
    at /Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/call-stream.ts:276:24
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
21:10:36 SILL StateSwitch <PuppetService> off() is false
21:10:36 VERB StateSwitch <PuppetService> off(true) <- (false)
21:10:36 WARN Puppet reset() exception: Error: 14 UNAVAILABLE: No connection established
==========error==========
Error

Already resolved.