[3.2] Remove hardcoded 10ms limit for chain_api_plugin calls #96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously
http-max-response-time-ms
controlled a limit on time for converting internal representation (variant) to a JSON string. Nowhttp-max-response-time-ms
will work as described, "Maximum time for processing a request.". It will put a limit on the time for the complete http call for thechain_api_plugin
calls specified below.http-max-response-time-ms
now supports-1
for unlimited.Similar to
abi-serializer-max-time-ms
,http-max-response-time-ms
is time the main thread is blocked. Be careful setting this very large on public API nodes as it does specify a max time that the main thread can be busy servicing an API request and not validating an incoming block.A block production node should not enable theIfchain_api_plugin
as these limits can interfere with block production windows.chain_api_plugin
is enabled on a block production node, make sure to set bothhttp-max-response-time-ms
&abi-serializer-max-time-ms
to small values to help avoid interference with the block production window.http-max-response-time-ms
- Controls maximum time of execution of the followingchain_api_plugin
calls./v1/chain/get_activated_protocol_features
/v1/chain/get_table_rows
/v1/chain/get_table_by_scope
/v1/chain/get_producers
/v1/chain/get_scheduled_transactions
The above API calls now all support an optional
time_limit_ms
defaulting to 10ms to provide previous behavior. Alsocleos
commandsget table
,get table scope
, andget_producers
now take a--time-limit
which allows for overriding the default 10ms limit. This time limit will be used as before to limit the returned output. Note thenodeos
configuredhttp-max-response-time-ms
will take precedence and hard fail any http request taking longer thanhttp-max-response-time-ms
. Also--time-limit
will be ignored by anynodeos
that does not have these PR changes.Example cleos:
This enables setting
http-max-response-time-ms
to-1
on a local nodeos and specifying--limit 999999 --time-limit 999999
tocleos get table
allowing users to retrieve complete table output without multiple calls to get table. Note this will block the main thread during the complete call.Resolves eosnetworkfoundation/mandel#819