Cleanup does not seem to work correctly
omitar opened this issue · comments
When connecting to oasis chain
, the following does not exit the node process:
const oasis = require('@oasislabs/client');
const wallet = oasis.Wallet.fromMnemonic('range drive remove bleak mule satisfy mandate east lion minimum unfold ready', "m/44'/60'/0'/0");
const gateway = new oasis.gateways.Web3Gateway('ws://127.0.0.1:8546/ws', wallet);
gateway.disconnect();
But it stays running. I think this means not everything was cleared in node process and it is waiting. But I think this should not happen and disconnect
should clean things fully, no?
disconnect
will clean up the websocket connection. Can you provide more information on what you suspect is not being cleaned up? Maybe an unresolved promise?
Run the example above. I would expect that the script terminates. But it does not. I do not know why it does not (what is keeping node process from terminating), but it is probably pointing to something not being cleaned up correctly/fully.
Odd because we do this in CI and the process terminates without issue. I'll check this out tomorrow.
Hm, then maybe it is some strange combination of versions of libraries, node, etc. If you cannot reproduce it, tell me and I can try to provide more details.
It might be connected to oasislabs/oasis-chain#46.
I can reproduce on 1.0.0-rc.14
.
Fixed by #257. Closing.