mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Increased max queue limits from 64 to 254 (#344)
This commit is contained in:
@@ -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])
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user