Parcourir la source

[3973] Added todos for the lease reclamation routines.

Marcin Siodelski il y a 9 ans
Parent
commit
2ead25cbea

+ 4 - 0
src/lib/dhcpsrv/alloc_engine.cc

@@ -1291,6 +1291,8 @@ AllocEngine::reclaimExpiredLeases6(const size_t max_leases, const uint16_t timeo
 
     // Create stopwatch and automatically start it to measure the time
     // taken by the routine.
+    /// @todo Monitor time elapsed and return from the lease reclamation routine
+    /// if it hits the timeout value.
     util::Stopwatch stopwatch;
 
     LeaseMgr& lease_mgr = LeaseMgrFactory::instance();
@@ -1371,6 +1373,8 @@ AllocEngine::reclaimExpiredLeases4(const size_t max_leases, const uint16_t timeo
 
     // Create stopwatch and automatically start it to measure the time
     // taken by the routine.
+    /// @todo Monitor time elapsed and return from the lease reclamation routine
+    /// if it hits the timeout value.
     util::Stopwatch stopwatch;
 
     LeaseMgr& lease_mgr = LeaseMgrFactory::instance();

+ 10 - 0
src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc

@@ -146,6 +146,16 @@ struct UpperBound {
 /// "expired-reclaimed".
 ///
 /// See @c ExpirationAllocEngineTest::testLeases for further details.
+///
+/// @todo These tests should be extended to cover the following cases:
+/// - timeout value in the lease reclamation routines - the most reliable
+///   way to test it will be by attaching a lease4_expire/lease6_expire
+///   hooks which would block for a specific period of time. This will
+///   allow for calculating the approximate number of reclaimed leases
+///   within a given timeout. See ticket #3972.
+/// - declined leases - declined leases expire and should be removed
+///   from the lease database by the lease reclamation routine. See
+///   ticket #3976.
 template<typename LeasePtrType>
 class ExpirationAllocEngineTest : public ::testing::Test {
 public: