Increased max queue limits from 64 to 254 (#344)

This commit is contained in:
Chalith Desaman
2021-08-19 19:10:54 +05:30
committed by GitHub
parent 9c7471a7db
commit d3df42db4e
4 changed files with 14 additions and 13 deletions

View File

@@ -10,7 +10,7 @@ namespace comm
{
constexpr uint32_t INTERVALMS = 60000;
constexpr uint32_t UNVERIFIED_INACTIVE_TIMEOUT = 5000; // Time threshold ms for unverified inactive connections.
constexpr uint16_t MAX_IN_MSG_QUEUE_SIZE = 64; // Maximum in message queue size, The size passed is rounded to next number in binary sequence 1(1),11(3),111(7),1111(15),11111(31)....
constexpr uint16_t MAX_IN_MSG_QUEUE_SIZE = 255; // Maximum in message queue size, The size passed is rounded to next number in binary sequence 1(1),11(3),111(7),1111(15),11111(31)....
comm_session::comm_session(
std::string_view host_address, hpws::client &&hpws_client, const bool is_inbound, const uint64_t (&metric_thresholds)[5])

View File

@@ -14,13 +14,13 @@
namespace p2p
{
constexpr uint16_t PROPOSAL_LIST_CAP = 128; // Maximum proposal count.
constexpr uint16_t NONUNL_PROPOSAL_LIST_CAP = 128; // Maximum nonunl proposal count.
constexpr uint16_t HPFS_REQ_LIST_CAP = 64; // Maximum state request count.
constexpr uint16_t HPFS_RES_LIST_CAP = 64; // Maximum state response count.
constexpr uint16_t PROPOSAL_LIST_CAP = 255; // Maximum proposal count.
constexpr uint16_t NONUNL_PROPOSAL_LIST_CAP = 255; // Maximum nonunl proposal count.
constexpr uint16_t HPFS_REQ_LIST_CAP = 255; // Maximum state request count.
constexpr uint16_t HPFS_RES_LIST_CAP = 255; // Maximum state response count.
constexpr uint16_t LOG_RECORD_REQ_LIST_CAP = 255; // Maximum log record request count.
constexpr uint16_t LOG_RECORD_RES_LIST_CAP = 255; // Maximum log record response count.
constexpr uint16_t PEER_LIST_CAP = 128; // Maximum peer count.
constexpr uint16_t LOG_RECORD_REQ_LIST_CAP = 64; // Maximum log record request count.
constexpr uint16_t LOG_RECORD_RES_LIST_CAP = 64; // Maximum log record response count.
// Struct to represent information about a peer.
// Initially available capacity is set to -1 and timestamp is set to 0.
@@ -37,7 +37,7 @@ namespace p2p
{
std::string pubkey;
util::h32 root_hash; // The proposal root hash (hash of all the proposal consensus fields). Only populated for incoming proposals.
bool from_self; // Whether the proposal was sent by this node itself. Only populated for incoming proposals.
bool from_self; // Whether the proposal was sent by this node itself. Only populated for incoming proposals.
uint64_t sent_timestamp = 0; // The timestamp of the sender when this proposal was sent.
uint64_t recv_timestamp = 0; // The timestamp when we received the proposal. (used for network statistics)

View File

@@ -16,8 +16,8 @@
*/
namespace sc
{
constexpr uint16_t MAX_NPL_MSG_QUEUE_SIZE = 64; // Maximum npl message queue size, The size passed is rounded to next number in binary sequence 1(1),11(3),111(7),1111(15),11111(31)....
constexpr uint16_t MAX_CONTROL_MSG_QUEUE_SIZE = 64; // Maximum out message queue size, The size passed is rounded to next number in binary sequence 1(1),11(3),111(7),1111(15),11111(31)....
constexpr uint16_t MAX_NPL_MSG_QUEUE_SIZE = 255; // Maximum npl message queue size, The size passed is rounded to next number in binary sequence 1(1),11(3),111(7),1111(15),11111(31)....
constexpr uint16_t MAX_CONTROL_MSG_QUEUE_SIZE = 255; // Maximum out message queue size, The size passed is rounded to next number in binary sequence 1(1),11(3),111(7),1111(15),11111(31)....
struct fd_pair
{

View File

@@ -12,8 +12,8 @@
*/
namespace read_req
{
constexpr uint16_t LOOP_WAIT = 100; // Milliseconds.
constexpr uint16_t MAX_QUEUE_SIZE = 64; // Maximum read request queue size, The size passed is rounded up to the next multiple of the block size (32).
constexpr uint16_t LOOP_WAIT = 100; // Milliseconds.
constexpr uint16_t MAX_QUEUE_SIZE = 255; // Maximum read request queue size, The size passed is rounded up to the next multiple of the block size (32).
bool is_shutting_down = false;
bool init_success = false;
@@ -229,7 +229,8 @@ namespace read_req
*/
void remove_thread(const pthread_t id)
{
const auto iter = std::find_if(read_req_threads.begin(), read_req_threads.end(), [=](std::thread &t) { return (t.native_handle() == id); });
const auto iter = std::find_if(read_req_threads.begin(), read_req_threads.end(), [=](std::thread &t)
{ return (t.native_handle() == id); });
if (iter != read_req_threads.end())
{
iter->join();