vechain / web3-gear

Proxy Thor's RESTful API to Eth JSON-RPC, to support Remix, Truffle and more.
MIT License
30 stars 17 forks source link

Server-hosted web3-gear instance stops listening for commands #20

Closed ShermanMeredith closed 5 years ago

ShermanMeredith commented 5 years ago

Something triggers my web3-gear instance to stop listening for external commands. The instance doesn't show any signs of having stopped listening, but does not react to JSON-RPC commands.

It can run smoothly for days at a time, and only stops working while I am making calls. I don't know what exactly triggers it to stop working.

The only solution has been to manually restart the web3-gear instance.

uldaman commented 5 years ago

What does the console display when gear stops working?

ShermanMeredith commented 5 years ago

These are the last 10 lines from the log. Nothing out of the ordinary: received rpc request - eth_getBlockByNumber received rpc request - eth_accounts received rpc request - net_version received rpc request - eth_accounts received rpc request - net_version received rpc request - eth_getBlockByNumber received rpc request - eth_accounts received rpc request - net_version received rpc request - eth_accounts received rpc request - net_version

ShermanMeredith commented 5 years ago

This didn't just happen once; it keeps happening and I have to keep restarting web3-gear.

uldaman commented 5 years ago

So, are these logs before the gear stops working?

After the gear stops working, will the console not output the log when you make calls?

ShermanMeredith commented 5 years ago

Correct

uldaman commented 5 years ago

When it happens next time, can you see if the gear port is being used?

lsof -i :8545
ShermanMeredith commented 5 years ago

Ok it happened again and this is what showed up when I did that command: 1__ubuntu_ip-172-31-30-126_____ssh_

uldaman commented 5 years ago

Ok, this seems to be no problem.

When it happens next time, you try again with the following command (remember to replace it with your ip:port):

curl 'http://localhost:8545/' -H 'Content-Type: application/json' --data-binary '{"jsonrpc":"2.0","id":79,"method":"eth_getBlockByNumber","params":["latest",false]}'

:simple_smile: Web3-gear has always been alive on my computer, I can't reproduce this error. So I need your help to analyze.

ShermanMeredith commented 5 years ago

The command failed to create any response when the server stopped responding. image

As soon as I restarted the Web3-gear instance I could send the command and got this: image

uldaman commented 5 years ago

At the moment, I can't judge what the problem is. I am trying to reproduce the bug. I will reply to you with the result. Thank you.

uldaman commented 5 years ago

I released a new version that uses a high-performance asynchronous architecture. You can update and try to use the new version to see if it solves your problem.

However, the new version has not been tested on a large scale, please use it with caution in the production environment.