Skip to content

Commit

Permalink
fix: network statistic input bytes is not right in some case(#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengyu committed Dec 20, 2023
1 parent 47c3c4a commit a30ed0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net/src/redis_conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ ReadStatus RedisConn::GetRequest() {
}

nread = read(fd(), rbuf_ + next_read_pos, remain);
g_network_statistic->IncrRedisInputBytes(nread);
if (nread == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
nread = 0;
Expand All @@ -100,6 +99,7 @@ ReadStatus RedisConn::GetRequest() {
// client closed, close client
return kReadClose;
}
g_network_statistic->IncrRedisInputBytes(nread);
// assert(nread > 0);
last_read_pos_ += static_cast<int32_t>(nread);
msg_peak_ = last_read_pos_;
Expand Down

0 comments on commit a30ed0a

Please sign in to comment.