fix use-of-uninitialized-value

This commit is contained in:
zhangxiao871 2022-01-13 17:49:39 +08:00
parent f9342ee2be
commit 264cb193bd

View File

@ -402,6 +402,8 @@ void KeeperDispatcher::sessionCleanerTask()
request->xid = Coordination::CLOSE_XID; request->xid = Coordination::CLOSE_XID;
KeeperStorage::RequestForSession request_info; KeeperStorage::RequestForSession request_info;
request_info.request = request; request_info.request = request;
using namespace std::chrono;
request_info.time = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
request_info.session_id = dead_session; request_info.session_id = dead_session;
{ {
std::lock_guard lock(push_request_mutex); std::lock_guard lock(push_request_mutex);
@ -479,6 +481,8 @@ int64_t KeeperDispatcher::getSessionID(int64_t session_timeout_ms)
request->server_id = server->getServerID(); request->server_id = server->getServerID();
request_info.request = request; request_info.request = request;
using namespace std::chrono;
request_info.time = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
request_info.session_id = -1; request_info.session_id = -1;
auto promise = std::make_shared<std::promise<int64_t>>(); auto promise = std::make_shared<std::promise<int64_t>>();