Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

RPC server fails to process a batch request, when --jsonrpc-server-threads is set #6753

Closed
Jeiwan opened this issue Oct 14, 2017 · 2 comments
Labels
F2-bug 🐞 The client fails to follow expected behavior. M6-rpcapi 📣 RPC API.
Milestone

Comments

@Jeiwan
Copy link

Jeiwan commented Oct 14, 2017

I'm running:

  • Parity version:
    • version Parity/v1.7.3-beta-083b69f-20170921/x86_64-linux-gnu/rustc1.19.0
    • version Parity/v1.7.5-beta-822fa82-20171012/x86_64-linux-gnu/rustc1.20.0
  • Operating system: Linux, Ubuntu, Linux Ubuntu-1704-zesty-64-minimal 4.10.0-35-generic More methods in Account, documentation and tests. #39-Ubuntu SMP Wed Sep 13 07:46:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • And installed: via installer

Actual
When --jsonrpc-server-threads is set to 2 (or any other number, actually):

➜  ~ curl -X POST --data '[{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x600baa6ac53103e682890241e01f84672eac39dbbb42a94df2a1c29b22e109f6"],"id":1},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x6064958550ca70813f6251ca0cee28be5d6cb648e18baea8798146ab59534c85"],"id":2},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x6cf9fd5e6f1b510f1d5dcb6ccf47c19c2b314cbd96e6829a4628933d27b6993d"],"id":3},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x6fbc2e7b5091ce879c4aceb2c8086f7693350f1018123283d7dd09a1b575af01"],"id":4},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xdf228ae05809006207579c313fc941f42f207e5a70d1f4d50c0db13064a69143"],"id":5},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x3405ef0bd77e3db7d9a7b108815d7c2e562d78950a781d3f691f81d617f51b1f"],"id":6},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x3f39f97b8f3151326c76c153672504cc223f0a2a65fc1fd8841c75af07afe01f"],"id":7},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xfd42ce030d72e50284ee01dca0231180c5e892abfc1741781770b65b983eaefd"],"id":8},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x4c3e1245748df152924353cb7db73f95d93b840f58f8a0100e4e2610061404ef"],"id":9},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x709dce5c9f831e0289791ed30a773bdd941e1c33c8b3d532219605a71f1bc69d"],"id":10}]'  -H 'Content-Type:application/json' http://localhost:8545
{"jsonrpc":"2.0","error":{"code":-32700,"message":"Parse error"},"id":null}

I noticed this happens only when there are 8 or more requests in a batch.
Also pay attention that it returns a hash, not an array.

Expected behavior
The same as when --jsonrpc-server-threads is not set:

➜  ~ curl -X POST --data '[{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x600baa6ac53103e682890241e01f84672eac39dbbb42a94df2a1c29b22e109f6"],"id":1},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x6064958550ca70813f6251ca0cee28be5d6cb648e18baea8798146ab59534c85"],"id":2},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x6cf9fd5e6f1b510f1d5dcb6ccf47c19c2b314cbd96e6829a4628933d27b6993d"],"id":3},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x6fbc2e7b5091ce879c4aceb2c8086f7693350f1018123283d7dd09a1b575af01"],"id":4},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xdf228ae05809006207579c313fc941f42f207e5a70d1f4d50c0db13064a69143"],"id":5},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x3405ef0bd77e3db7d9a7b108815d7c2e562d78950a781d3f691f81d617f51b1f"],"id":6},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x3f39f97b8f3151326c76c153672504cc223f0a2a65fc1fd8841c75af07afe01f"],"id":7},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xfd42ce030d72e50284ee01dca0231180c5e892abfc1741781770b65b983eaefd"],"id":8},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x4c3e1245748df152924353cb7db73f95d93b840f58f8a0100e4e2610061404ef"],"id":9},{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x709dce5c9f831e0289791ed30a773bdd941e1c33c8b3d532219605a71f1bc69d"],"id":10}]'  -H 'Content-Type:application/json' http://localhost:8545
[{"jsonrpc":"2.0","result":{"blockHash":"..."},id:"1"},...]
@tomusdrw tomusdrw added F2-bug 🐞 The client fails to follow expected behavior. M6-rpcapi 📣 RPC API. labels Oct 14, 2017
@tomusdrw
Copy link
Collaborator

Could you check if the error occurs on 1.8 as well?

@Jeiwan
Copy link
Author

Jeiwan commented Oct 15, 2017

It works fine on 1.8. Thank you!

@Jeiwan Jeiwan closed this as completed Oct 15, 2017
@5chdn 5chdn added this to the 1.8 milestone Oct 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F2-bug 🐞 The client fails to follow expected behavior. M6-rpcapi 📣 RPC API.
Projects
None yet
Development

No branches or pull requests

3 participants