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

Make the PuppetOICQ to be "perfect restart"-able #10

Open
huan opened this issue Oct 1, 2021 · 2 comments
Open

Make the PuppetOICQ to be "perfect restart"-able #10

huan opened this issue Oct 1, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@huan
Copy link
Member

huan commented Oct 1, 2021

We need to make the below unit test to be passed:

https://github.com/wechaty/wechaty-puppet-oicq/blob/321876d0df6400a38596eebb868d56aedac68384/src/puppet-oicq.spec.ts#L7-L16

So that it can comfort the puppet spec: perfect restart

@anaivebird
Copy link
Collaborator

I don't know why puppet.stop() could not finish.
Puppet stop() this.stop() done means the following code finished successfully:

  override async onStop (): Promise<void> {
    log.verbose('PuppetOICQ', 'onStop()')

    // TODO: should we close the oicqClient?
    this.oicqClient.terminate()
    this.#oicqClient = undefined
  }
src/puppet-oicq.spec.ts 1> 19:44:12 VERB PuppetOICQ onStop()
src/puppet-oicq.spec.ts 1> stoped
src/puppet-oicq.spec.ts 1> 19:44:12 VERB Puppet stop() this.stop() done
src/puppet-oicq.spec.ts 1> 19:44:12 VERB PuppetLoginMixin stop()
src/puppet-oicq.spec.ts 1> 19:44:12 VERB PuppetLoginMixin logout(logout())
src/puppet-oicq.spec.ts 1> 19:44:12 VERB PuppetLoginMixin logout() no currentUserId, do nothing
src/puppet-oicq.spec.ts 1> 19:44:12 VERB PuppetCacheMixin stop()
src/puppet-oicq.spec.ts 1> 19:44:12 VERB CacheAgent stop()
src/puppet-oicq.spec.ts 1> 19:44:12 VERB CacheAgent clear()
src/puppet-oicq.spec.ts 1> 19:44:12 VERB PuppetStateMixin stop()
src/puppet-oicq.spec.ts 1> 19:44:12 VERB PuppetMemoryMixin stop()
src/puppet-oicq.spec.ts 1> 19:44:12 VERB PuppetSkelton stop()
src/puppet-oicq.spec.ts 1> 19:44:12 VERB Puppet stop() super.stop() done
src/puppet-oicq.spec.ts 1> 19:44:12 VERB StateSwitch <PuppetState> off(true) <- (pending)

@huan
Copy link
Member Author

huan commented Oct 17, 2021

I believe there has some memory leak for timers.

You might also be interested in this discussion wechaty/puppet-walnut#9

Let's investigate it later.

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

No branches or pull requests

2 participants