0rpc/zerorpc-node

Code on npmjs.org is not synced with that on github.com, which will leads to memory leak.

crystaldust opened this issue · 4 comments

Hi, there,
I recently found that zerorpc.Server instance will cause memory leak, after digged it a little, I found that the code in npmjs.org and github.com is no synced. In the file:
lib/channel.js

At line 151, code on github:

151    if(this._state == CHANNEL_CLOSING && this._outBuffer.length() == 0) {

the code is correct, while at line 150, code on npmjs, the code is:

150    if(this.state == CHANNEL_CLOSING && this._outBuffer.length() == 0) {

The judgement refers to this.state, which is always undefined. So the condition will always be false, the code within the block(which delete the used channels) will never be done, thus leading to the memory leak.

I've found a zerorpc-fork on npmjs.org, which did the right thing:

https://www.npmjs.com/package/zerorpc-fork

Thanks for the report, I will release a new version soon.

done, new version released on npm 0.9.5.

Thanks bolmbela, happy to see the project is alive again!