beam
beam copied to clipboard
Wallet Api. EOF on requests
After migration to 6.0.1 we getting EOF answers from wallet api on requests when wallet-api goes to "sync mode"
wallet-api log:
May 30 06:47:01 p2 wallet-api[25630]: I 2021-05-30.06:47:01.475 got {"id":1,"jsonrpc":"2.0","method":"tx_status","params":{"txId":"328feeef4b464c328f75b2fdda89a1
May 30 06:47:01 p2 wallet-api[25630]: D 2021-05-30.06:47:01.475 executeAPIRequest. Method: tx_status, params: {"txId":"328feeef4b464c328f75b2fdda89a102"}
May 30 06:47:01 p2 wallet-api[25630]: D 2021-05-30.06:47:01.475 Status(txId = 328feeef4b464c328f75b2fdda89a102)
May 30 06:47:05 p2 wallet-api[25630]: D 2021-05-30.06:47:05.586 +peer 127.0.0.1:40790
May 30 06:47:05 p2 wallet-api[25630]: D 2021-05-30.06:47:05.586 on_stream_accepted
May 30 06:47:05 p2 wallet-api[25630]: I 2021-05-30.06:47:05.586 got {"id":1,"jsonrpc":"2.0","method":"tx_status","params":{"txId":"e30a6c3bc3044806a83ff322ccb69d
May 30 06:47:05 p2 wallet-api[25630]: D 2021-05-30.06:47:05.586 executeAPIRequest. Method: tx_status, params: {"txId":"e30a6c3bc3044806a83ff322ccb69d2f"}
May 30 06:47:05 p2 wallet-api[25630]: D 2021-05-30.06:47:05.586 Status(txId = e30a6c3bc3044806a83ff322ccb69d2f)
May 30 06:47:05 p2 wallet-api[25630]: I 2021-05-30.06:47:05.646 Sync up to 1259386-37304f4163cc4a7a
May 30 06:47:05 p2 wallet-api[25630]: I 2021-05-30.06:47:05.646 Synchronizing with node: 0% (0/2)
May 30 06:47:05 p2 wallet-api[25630]: I 2021-05-30.06:47:05.694 Synchronizing with node: 50% (1/2)
May 30 06:47:05 p2 wallet-api[25630]: I 2021-05-30.06:47:05.694 Synchronizing with node: 100% (2/2)
May 30 06:47:05 p2 wallet-api[25630]: I 2021-05-30.06:47:05.694 Current state is 1259386-37304f4163cc4a7a
May 30 06:47:05 p2 wallet-api[25630]: D 2021-05-30.06:47:05.879 IsMobileNodeEnabled()=0 m_Extra.m_ShieldedOutputs=1165 Node shielded outs=1165
May 30 06:47:06 p2 wallet-api[25630]: D 2021-05-30.06:47:06.169 +peer 127.0.0.1:40818
May 30 06:47:06 p2 wallet-api[25630]: D 2021-05-30.06:47:06.169 on_stream_accepted
May 30 06:47:06 p2 wallet-api[25630]: I 2021-05-30.06:47:06.169 got {"id":1,"jsonrpc":"2.0","method":"tx_status","params":{"txId":"66fbed3ff30842f3a0543ec7bfcf4f
May 30 06:47:06 p2 wallet-api[25630]: D 2021-05-30.06:47:06.169 executeAPIRequest. Method: tx_status, params: {"txId":"66fbed3ff30842f3a0543ec7bfcf4f1e"}
May 30 06:47:06 p2 wallet-api[25630]: D 2021-05-30.06:47:06.169 Status(txId = 66fbed3ff30842f3a0543ec7bfcf4f1e)
payouts side:
2021/05/30 06:47:05 Cancelling tx e30a6c3bc3044806a83ff322ccb69d2f
2021/05/30 06:47:05 Failed to cancel tx e30a6c3bc3044806a83ff322ccb69d2f: Post "http://127.0.0.1:8105/api/wallet": EOF
looks like request was totally ignored.
Same here, tx_cancel
just doesn't work at all, I think it has nothing to do with "sync mode". Getting ECONNRESET/socket hang up on that method, while tx_send
or tx_status
work flawlessly.
the quick fix https://github.com/BeamMW/beam/commit/6cbd73dcb63643a39246798e34248cfecf5882af
Need to rework _keepalive to handle send error for Async methods and avoid possible timeout. Probably move close connection inside send.
Need to add tests (after server code is extracted) or review integration tests for this.
Send consequently
- tx_send -> id
- tx_cancel (id)
Ensure that connection is not reset