diff --git a/plugins/http_plugin/http_plugin.cpp b/plugins/http_plugin/http_plugin.cpp index 6e914d5702..892950e445 100644 --- a/plugins/http_plugin/http_plugin.cpp +++ b/plugins/http_plugin/http_plugin.cpp @@ -357,9 +357,9 @@ namespace eosio { ("max-body-size", bpo::value()->default_value(my->plugin_state->max_body_size), "The maximum body size in bytes allowed for incoming RPC requests") ("http-max-bytes-in-flight-mb", bpo::value()->default_value(500), - "Maximum size in megabytes http_plugin should use for processing http requests. -1 for unlimited. 429 error response when exceeded." ) + "Maximum size in megabytes http_plugin should use for processing http requests. -1 for unlimited. 503 error response when exceeded." ) ("http-max-in-flight-requests", bpo::value()->default_value(-1), - "Maximum number of requests http_plugin should use for processing http requests. 429 error response when exceeded." ) + "Maximum number of requests http_plugin should use for processing http requests. 503 error response when exceeded." ) ("http-max-response-time-ms", bpo::value()->default_value(15), "Maximum time on main thread for processing a request, -1 for unlimited") ("verbose-http-errors", bpo::bool_switch()->default_value(false), diff --git a/plugins/http_plugin/include/eosio/http_plugin/beast_http_session.hpp b/plugins/http_plugin/include/eosio/http_plugin/beast_http_session.hpp index dac0468216..b24b1b0501 100644 --- a/plugins/http_plugin/include/eosio/http_plugin/beast_http_session.hpp +++ b/plugins/http_plugin/include/eosio/http_plugin/beast_http_session.hpp @@ -219,18 +219,18 @@ class beast_http_session : public detail::abstract_conn, virtual void send_busy_response(std::string&& what) final { error_results::error_info ei; - ei.code = static_cast(http::status::too_many_requests); + ei.code = static_cast(http::status::service_unavailable); ei.name = "Busy"; ei.what = std::move(what); - error_results results{static_cast(http::status::too_many_requests), "Busy", ei}; + error_results results{static_cast(http::status::service_unavailable), "Busy", ei}; send_response(fc::json::to_string(results, fc::time_point::maximum()), - static_cast(http::status::too_many_requests) ); + static_cast(http::status::service_unavailable) ); } virtual std::string verify_max_bytes_in_flight(size_t extra_bytes) final { auto bytes_in_flight_size = plugin_state_->bytes_in_flight.load() + extra_bytes; if(bytes_in_flight_size > plugin_state_->max_bytes_in_flight) { - fc_dlog(plugin_state_->get_logger(), "429 - too many bytes in flight: ${bytes}", ("bytes", bytes_in_flight_size)); + fc_dlog(plugin_state_->get_logger(), "503 - too many bytes in flight: ${bytes}", ("bytes", bytes_in_flight_size)); return "Too many bytes in flight: " + std::to_string( bytes_in_flight_size ); } return {}; @@ -242,7 +242,7 @@ class beast_http_session : public detail::abstract_conn, auto requests_in_flight_num = plugin_state_->requests_in_flight.load(); if(requests_in_flight_num > plugin_state_->max_requests_in_flight) { - fc_dlog(plugin_state_->get_logger(), "429 - too many requests in flight: ${requests}", ("requests", requests_in_flight_num)); + fc_dlog(plugin_state_->get_logger(), "503 - too many requests in flight: ${requests}", ("requests", requests_in_flight_num)); return "Too many requests in flight: " + std::to_string( requests_in_flight_num ); } return {};