Add some debug output.

GitOrigin-RevId: 87f724672d2e21c4c0640b1a4e610acf51260d2a
This commit is contained in:
levlam 2018-01-28 23:38:55 +03:00
parent b066d34457
commit 816b02e8c6
5 changed files with 12 additions and 9 deletions

View File

@ -5512,7 +5512,7 @@ void MessagesManager::add_pending_channel_update(DialogId dialog_id, tl_object_p
if (d == nullptr || pts_count > 0) {
process_channel_update(std::move(update));
CHECK(!running_get_channel_difference(dialog_id));
CHECK(!running_get_channel_difference(dialog_id)) << '"' << active_get_channel_differencies_[dialog_id] << '"';
} else {
LOG_IF(INFO, update->get_id() != dummyUpdate::ID)
<< "Skip useless channel update from " << source << ": " << to_string(update);
@ -22967,7 +22967,7 @@ void MessagesManager::get_channel_difference(DialogId dialog_id, int32 pts, bool
void MessagesManager::do_get_channel_difference(DialogId dialog_id, int32 pts, bool force,
tl_object_ptr<telegram_api::InputChannel> &&input_channel,
const char *source) {
auto inserted = active_get_channel_differencies_.insert(dialog_id);
auto inserted = active_get_channel_differencies_.emplace(dialog_id, source);
if (!inserted.second) {
LOG(INFO) << "Skip running channels.getDifference for " << dialog_id << " from " << source
<< " because it has already been run";
@ -23019,7 +23019,7 @@ void MessagesManager::process_get_channel_difference_updates(
}
}
}
CHECK(!running_get_channel_difference(dialog_id));
CHECK(!running_get_channel_difference(dialog_id)) << '"' << active_get_channel_differencies_[dialog_id] << '"';
}
void MessagesManager::on_get_channel_dialog(DialogId dialog_id, MessageId last_message_id,
@ -23261,7 +23261,7 @@ void MessagesManager::on_get_channel_difference(
}
void MessagesManager::after_get_channel_difference(DialogId dialog_id, bool success) {
CHECK(!running_get_channel_difference(dialog_id));
CHECK(!running_get_channel_difference(dialog_id)) << '"' << active_get_channel_differencies_[dialog_id] << '"';
auto logevent_it = get_channel_difference_to_logevent_id_.find(dialog_id);
if (logevent_it != get_channel_difference_to_logevent_id_.end()) {

View File

@ -2584,7 +2584,7 @@ class MessagesManager : public Actor {
MultiPromiseActor load_dialog_list_multipromise_; // should be defined before pending_on_get_dialogs_
Timeout preload_dialog_list_timeout_;
std::unordered_set<DialogId, DialogIdHash> active_get_channel_differencies_;
std::unordered_map<DialogId, string, DialogIdHash> active_get_channel_differencies_;
std::unordered_map<DialogId, uint64, DialogIdHash> get_channel_difference_to_logevent_id_;
MultiTimeout channel_get_difference_timeout_;

View File

@ -59,7 +59,7 @@ FileId StickersManager::parse_sticker(bool in_sticker_set, T &parser) {
PARSE_FLAG(has_sticker_set_access_hash);
PARSE_FLAG(in_sticker_set_stored);
END_PARSE_FLAGS();
CHECK(in_sticker_set_stored == in_sticker_set);
CHECK(in_sticker_set_stored == in_sticker_set) << in_sticker_set << " " << in_sticker_set_stored;
if (!in_sticker_set) {
parse(sticker->set_id, parser);
if (has_sticker_set_access_hash) {

View File

@ -996,7 +996,8 @@ Result<FileId> FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sy
bool send_updates_flag = false;
for (auto file_id : other_node->file_ids_) {
auto file_id_info = get_file_id_info(file_id);
CHECK(file_id_info->node_id_ == node_ids[other_node_i]);
CHECK(file_id_info->node_id_ == node_ids[other_node_i])
<< node_ids[node_i] << " " << node_ids[other_node_i] << " " << file_id << " " << file_id_info->node_id_;
file_id_info->node_id_ = node_ids[node_i];
send_updates_flag |= file_id_info->send_updates_flag_;
}

View File

@ -72,7 +72,8 @@ Status PartsManager::init(int64 size, bool is_size_final, size_t part_size, cons
}
CHECK(1 <= size_) << tag("size_", size_);
CHECK(!use_part_count_limit || (size_ + part_size_ - 1) / part_size_ <= MAX_PART_COUNT)
<< tag("size_", size_) << tag("part_size_", part_size_);
<< tag("size_", size_) << tag("is_size_final", is_size_final) << tag("part_size_", part_size_)
<< tag("ready_parts", ready_parts.size());
part_count_ = static_cast<int>((size + part_size_ - 1) / part_size_);
init_common(ready_parts);
@ -157,7 +158,8 @@ void PartsManager::set_known_prefix(size_t size, bool is_ready) {
} else {
part_count_ = static_cast<int>(size / part_size_);
}
CHECK(static_cast<size_t>(part_count_) >= part_status_.size());
CHECK(static_cast<size_t>(part_count_) >= part_status_.size())
<< size << " " << is_ready << " " << part_count_ << " " << part_size_ << " " << part_status_.size();
part_status_.resize(part_count_);
}