Stabilize bgp_peer_test by making sure that prefix_limit_trigger is not set before its peer deletion

Bug #1706792 reported by Ananth Suryanarayana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.2
Fix Committed
High
Ananth Suryanarayana
R4.0
Fix Committed
High
Ananth Suryanarayana
Trunk
Fix Committed
High
Ananth Suryanarayana

Bug Description

Recently added prefix_limit_trigger_ trigger is set as part of the BgpPeer::BgpPeer() constructor. Hence it necessary to make sure that in BgpPeer::~BgpPeer() in any of the mock peer code, we wait until the task is run and not set any more.

#0 0x00002b95be6b2c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00002b95be6b6028 in __GI_abort () at abort.c:89
#2 0x00002b95be6abbf6 in __assert_fail_base (fmt=0x2b95be7fc3b8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x201cf7c "!trigger_", file=file@entry=0x201cf58 "controller/src/base/task_trigger.cc", line=line@entry=42, function=function@entry=0x201cff0 <TaskTrigger::~TaskTrigger()::__PRETTY_FUNCTION__> "TaskTrigger::~TaskTrigger()") at assert.c:92
#3 0x00002b95be6abca2 in __GI___assert_fail (assertion=0x201cf7c "!trigger_", file=0x201cf58 "controller/src/base/task_trigger.cc", line=42, function=0x201cff0 <TaskTrigger::~TaskTrigger()::__PRETTY_FUNCTION__> "TaskTrigger::~TaskTrigger()") at assert.c:101
#4 0x0000000001315b94 in TaskTrigger::~TaskTrigger (this=0x391dcd8, __in_chrg=<optimized out>) at controller/src/base/task_trigger.cc:42
#5 0x0000000001402f78 in BgpPeer::~BgpPeer (this=0x391dc00, __in_chrg=<optimized out>) at controller/src/bgp/bgp_peer.cc:584
#6 0x0000000001367719 in BgpPeerMock::~BgpPeerMock (this=0x391dc00, __in_chrg=<optimized out>) at controller/src/bgp/test/bgp_peer_test.cc:45
#7 0x0000000001367748 in BgpPeerMock::~BgpPeerMock (this=0x391dc00, __in_chrg=<optimized out>) at controller/src/bgp/test/bgp_peer_test.cc:45
#8 0x0000000001367780 in boost::checked_delete<BgpPeerMock> (x=0x391dc00) at /usr/include/boost/checked_delete.hpp:34
#9 0x0000000001366741 in boost::scoped_ptr<BgpPeerMock>::~scoped_ptr (this=0x7ffcd4966310, __in_chrg=<optimized out>) at /usr/include/boost/smart_ptr/scoped_ptr.hpp:82
#10 0x0000000001366825 in boost::scoped_ptr<BgpPeerMock>::reset (this=0x39370f0, p=0x3926b70) at /usr/include/boost/smart_ptr/scoped_ptr.hpp:88
#11 0x0000000001365554 in BgpPeerTest::Reset (this=0x3936c00, config=0x7ffcd49666c0) at controller/src/bgp/test/bgp_peer_test.cc:119
#12 0x000000000134d882 in BgpPeerTest_BufferCapacity7_Test::TestBody (this=0x3936c00) at controller/src/bgp/test/bgp_peer_test.cc:278
#13 0x0000000001e3b516 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (object=0x3936c00, method=&virtual testing::Test::TestBody(), location=0x2173453 "the test body") at /usr/src/gmock/gtest/src/gtest.cc:2078
#14 0x0000000001e36dc8 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x3936c00, method=&virtual testing::Test::TestBody(), location=0x2173453 "the test body") at /usr/src/gmock/gtest/src/gtest.cc:2114
#15 0x0000000001e1f05b in testing::Test::Run (this=0x3936c00) at /usr/src/gmock/gtest/src/gtest.cc:2151
#16 0x0000000001e1f836 in testing::TestInfo::Run (this=0x3833770) at /usr/src/gmock/gtest/src/gtest.cc:2326
#17 0x0000000001e1fec6 in testing::TestCase::Run (this=0x3832de0) at /usr/src/gmock/gtest/src/gtest.cc:2444
#18 0x0000000001e26510 in testing::internal::UnitTestImpl::RunAllTests (this=0x3832a80) at /usr/src/gmock/gtest/src/gtest.cc:4261
#19 0x0000000001e3c4ca in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x3832a80, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x1e26292 <testing::internal::UnitTestImpl::RunAllTests()>, location=0x2173d10 "auxiliary test code (environments or event listeners)") at /usr/src/gmock/gtest/src/gtest.cc:2078
#20 0x0000000001e37a74 in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x3832a80, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x1e26292 <testing::internal::UnitTestImpl::RunAllTests()>, location=0x2173d10 "auxiliary test code (environments or event listeners)") at /usr/src/gmock/gtest/src/gtest.cc:2114
#21 0x0000000001e251cf in testing::UnitTest::Run (this=0x28c93c0 <testing::UnitTest::GetInstance()::instance>) at /usr/src/gmock/gtest/src/gtest.cc:3875
#22 0x000000000136445c in RUN_ALL_TESTS () at build/include/gtest/gtest.h:2288
#23 0x000000000136364e in main (argc=1, argv=0x7ffcd4966c68) at controller/src/bgp/test/bgp_peer_test.cc:600
(gdb)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/34039
Submitter: Ananth Suryanarayana (<email address hidden>)

Nischal Sheth (nsheth)
tags: added: contrail-control
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/34092
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.2

Review in progress for https://review.opencontrail.org/34093
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/34039
Committed: http://github.com/Juniper/contrail-controller/commit/701a76c4f9cd64846ea17a7f2b430876246038f5
Submitter: Zuul (<email address hidden>)
Branch: master

commit 701a76c4f9cd64846ea17a7f2b430876246038f5
Author: Ananth Suryanarayana <email address hidden>
Date: Wed Jul 26 15:07:37 2017 -0700

Do not trigger prefix_limit_trigger_ from BgpPeer constructor

Instead, trigger only when configuration changes are processed.
Also, trigger prefix_limit_trigger_ through a virtualized method so that
BgpMockPeers can override and skip the actual task trigger process.

Change-Id: I16befdad1cf43ef467da8dfc7d2994ddc005ca3a
Closes-Bug: 1706792

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/34092
Committed: http://github.com/Juniper/contrail-controller/commit/c89da83cf3642989684f40b3539e06a36632f134
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit c89da83cf3642989684f40b3539e06a36632f134
Author: Ananth Suryanarayana <email address hidden>
Date: Wed Jul 26 15:07:37 2017 -0700

Do not trigger prefix_limit_trigger_ from BgpPeer constructor

Instead, trigger only when configuration changes are processed.
Also, trigger prefix_limit_trigger_ through a virtualized method so that
BgpMockPeers can override and skip the actual task trigger process.

Change-Id: I16befdad1cf43ef467da8dfc7d2994ddc005ca3a
Closes-Bug: 1706792

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/34093
Committed: http://github.com/Juniper/contrail-controller/commit/cc2aa803d192c5c60c116dc818f5b67018d14212
Submitter: Zuul (<email address hidden>)
Branch: R3.2

commit cc2aa803d192c5c60c116dc818f5b67018d14212
Author: Ananth Suryanarayana <email address hidden>
Date: Wed Jul 26 15:07:37 2017 -0700

Do not trigger prefix_limit_trigger_ from BgpPeer constructor

Instead, trigger only when configuration changes are processed.
Also, trigger prefix_limit_trigger_ through a virtualized method so that
BgpMockPeers can override and skip the actual task trigger process.

Change-Id: I16befdad1cf43ef467da8dfc7d2994ddc005ca3a
Closes-Bug: 1706792

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.