Minor improvements.
GitOrigin-RevId: e86b66d0cd5b78a02ce401c40a2c2fffc1bb5a3c
This commit is contained in:
parent
99fa220ae5
commit
2d22f4d13e
@ -77,14 +77,14 @@ void dump_pending_network_queries() {
|
|||||||
LOG(WARNING) << "...";
|
LOG(WARNING) << "...";
|
||||||
was_gap = false;
|
was_gap = false;
|
||||||
}
|
}
|
||||||
auto nq = &cur->get_data_unsafe();
|
const NetQueryDebug &debug = cur->get_data_unsafe();
|
||||||
LOG(WARNING) << tag("id", nq->my_id_) << *static_cast<NetQuery *>(cur)
|
LOG(WARNING) << tag("id", debug.my_id_) << *static_cast<const NetQuery *>(cur)
|
||||||
<< /*tag("total_flood", format::as_time(nq->total_timeout_)) <<*/ " "
|
<< /*tag("total_flood", format::as_time(debug.total_timeout_)) <<*/ " "
|
||||||
<< tag("since start", format::as_time(Time::now_cached() - nq->start_timestamp_))
|
<< tag("since start", format::as_time(Time::now_cached() - debug.start_timestamp_))
|
||||||
<< tag("state", nq->debug_str_)
|
<< tag("state", debug.debug_str_)
|
||||||
<< tag("since state", format::as_time(Time::now_cached() - nq->debug_timestamp_))
|
<< tag("since state", format::as_time(Time::now_cached() - debug.debug_timestamp_))
|
||||||
<< tag("resend_cnt", nq->debug_resend_cnt_) << tag("fail_cnt", nq->debug_send_failed_cnt_)
|
<< tag("resend_cnt", debug.debug_resend_cnt_) << tag("fail_cnt", debug.debug_send_failed_cnt_)
|
||||||
<< tag("ack", nq->debug_ack) << tag("unknown", nq->debug_unknown);
|
<< tag("ack", debug.debug_ack_) << tag("unknown", debug.debug_unknown_);
|
||||||
} else {
|
} else {
|
||||||
was_gap = true;
|
was_gap = true;
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ struct NetQueryDebug {
|
|||||||
double debug_timestamp_ = 0;
|
double debug_timestamp_ = 0;
|
||||||
int32 debug_cnt_ = 0;
|
int32 debug_cnt_ = 0;
|
||||||
int32 debug_send_failed_cnt_ = 0;
|
int32 debug_send_failed_cnt_ = 0;
|
||||||
int debug_ack = 0;
|
int debug_ack_ = 0;
|
||||||
bool debug_unknown = false;
|
bool debug_unknown_ = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern TsList<NetQueryDebug> net_query_list_;
|
extern TsList<NetQueryDebug> net_query_list_;
|
||||||
|
@ -619,7 +619,7 @@ void Session::on_message_ack_impl_inner(uint64 id, int32 type, bool in_container
|
|||||||
it->second.ack = true;
|
it->second.ack = true;
|
||||||
{
|
{
|
||||||
auto lock = it->second.query->lock();
|
auto lock = it->second.query->lock();
|
||||||
it->second.query->get_data_unsafe().debug_ack |= type;
|
it->second.query->get_data_unsafe().debug_ack_ |= type;
|
||||||
}
|
}
|
||||||
it->second.query->quick_ack_promise_.set_value(Unit());
|
it->second.query->quick_ack_promise_.set_value(Unit());
|
||||||
if (!in_container) {
|
if (!in_container) {
|
||||||
@ -657,7 +657,7 @@ void Session::cleanup_container(uint64 message_id, Query *query) {
|
|||||||
void Session::mark_as_known(uint64 id, Query *query) {
|
void Session::mark_as_known(uint64 id, Query *query) {
|
||||||
{
|
{
|
||||||
auto lock = query->query->lock();
|
auto lock = query->query->lock();
|
||||||
query->query->get_data_unsafe().debug_unknown = false;
|
query->query->get_data_unsafe().debug_unknown_ = false;
|
||||||
}
|
}
|
||||||
if (!query->unknown) {
|
if (!query->unknown) {
|
||||||
return;
|
return;
|
||||||
@ -673,7 +673,7 @@ void Session::mark_as_known(uint64 id, Query *query) {
|
|||||||
void Session::mark_as_unknown(uint64 id, Query *query) {
|
void Session::mark_as_unknown(uint64 id, Query *query) {
|
||||||
{
|
{
|
||||||
auto lock = query->query->lock();
|
auto lock = query->query->lock();
|
||||||
query->query->get_data_unsafe().debug_unknown = true;
|
query->query->get_data_unsafe().debug_unknown_ = true;
|
||||||
}
|
}
|
||||||
if (query->unknown) {
|
if (query->unknown) {
|
||||||
return;
|
return;
|
||||||
@ -941,8 +941,8 @@ void Session::connection_send_query(ConnectionInfo *info, NetQueryPtr &&net_quer
|
|||||||
LOG_CHECK(sent_queries_.find(message_id) == sent_queries_.end()) << message_id;
|
LOG_CHECK(sent_queries_.find(message_id) == sent_queries_.end()) << message_id;
|
||||||
{
|
{
|
||||||
auto lock = net_query->lock();
|
auto lock = net_query->lock();
|
||||||
net_query->get_data_unsafe().debug_unknown = false;
|
net_query->get_data_unsafe().debug_unknown_ = false;
|
||||||
net_query->get_data_unsafe().debug_ack = 0;
|
net_query->get_data_unsafe().debug_ack_ = 0;
|
||||||
}
|
}
|
||||||
if (!net_query->cancel_slot_.empty()) {
|
if (!net_query->cancel_slot_.empty()) {
|
||||||
LOG(DEBUG) << "Set event for net_query cancellation " << tag("message_id", format::as_hex(message_id));
|
LOG(DEBUG) << "Set event for net_query cancellation " << tag("message_id", format::as_hex(message_id));
|
||||||
|
@ -6,12 +6,14 @@
|
|||||||
//
|
//
|
||||||
#include "td/utils/common.h"
|
#include "td/utils/common.h"
|
||||||
#include "td/utils/List.h"
|
#include "td/utils/List.h"
|
||||||
|
#include "td/utils/port/thread.h"
|
||||||
#include "td/utils/Random.h"
|
#include "td/utils/Random.h"
|
||||||
#include "td/utils/tests.h"
|
#include "td/utils/tests.h"
|
||||||
#include "td/utils/TsList.h"
|
#include "td/utils/TsList.h"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
struct Data {
|
struct Data {
|
||||||
td::uint64 value{0};
|
td::uint64 value{0};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user