Skip to content

Commit

Permalink
Merge "1. In UdpServer HandleReceive/SendInternal do not deallocate t…
Browse files Browse the repository at this point in the history
…he buffer if the UdpServer state is not OK since it will already be freed during Shutdown. This was uncovered during coverage runs. 2. Fix SyslogCollectorTest crash when running multiple iterations by moving Sandesh::Uninit before the thread join in Teardown(). Ran 100 iterations without any crash."
  • Loading branch information
Zuul authored and Gerrit Code Review committed Sep 24, 2014
2 parents c8af3f2 + 25cde0b commit 50aa9b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/analytics/test/syslog_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ class SyslogCollectorTest : public ::testing::Test
task_util::WaitForIdle();
evm_->Shutdown();
task_util::WaitForIdle();
Sandesh::Uninit();
task_util::WaitForIdle();
if (thread_.get() != NULL) {
thread_->Join();
}
Sandesh::Uninit();
task_util::WaitForIdle();
}
SyslogMsgGen *gen_;
Expand Down
2 changes: 0 additions & 2 deletions src/io/udp_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ void UdpServer::HandleSendInternal(const_buffer send_buffer,
stats_.write_errors++;
UDP_SERVER_LOG_ERROR(this, UDP_DIR_OUT,
"Send UDP server in WRONG state: " << state_);
DeallocateBuffer(send_buffer);
return;
}
if (error) {
Expand Down Expand Up @@ -238,7 +237,6 @@ void UdpServer::HandleReceiveInternal(const_buffer recv_buffer,
stats_.read_errors++;
UDP_SERVER_LOG_ERROR(this, UDP_DIR_IN,
"Receive UDP server in WRONG state: " << state_);
DeallocateBuffer(recv_buffer);
return;
}
if (error) {
Expand Down

0 comments on commit 50aa9b0

Please sign in to comment.