]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Revert "[5649] IfaceMgr's select reacts on sending data over control channel."
authorMarcin Siodelski <marcin@isc.org>
Thu, 14 Jun 2018 07:17:19 +0000 (09:17 +0200)
committerMarcin Siodelski <marcin@isc.org>
Thu, 14 Jun 2018 07:17:19 +0000 (09:17 +0200)
This reverts commit 83f252d8cd26066e181fe3842f3db20e87001a48.

src/hooks/dhcp/high_availability/ha_service.cc
src/hooks/dhcp/high_availability/ha_service.h
src/lib/dhcp/iface_mgr.cc

index cfef610f166124361dd0bb9dc87488d5bbd95e5a..84cbf1511db57c836070bd5db7ad4eeac77c70d9 100644 (file)
@@ -33,18 +33,6 @@ using namespace isc::http;
 using namespace isc::log;
 using namespace isc::util;
 
-namespace {
-
-/// @brief Timeout for synchronization of leases with partner.
-///
-/// This timeout is very high because in some cases the number of
-/// gathered leases is huge. Syncing should not really take that
-/// long, but if the partner doesn't respond we can't do anything
-/// useful anyway. So, it doesn't really matter.
-const long HA_SYNC_TIMEOUT = 60000;
-
-}
-
 namespace isc {
 namespace ha {
 
@@ -1227,7 +1215,7 @@ HAService::asyncSyncLeases(http::HttpClient& http_client,
                 post_sync_action(error_message.empty(),
                                  error_message);
             }
-    }, HttpClient::RequestTimeout(HA_SYNC_TIMEOUT));
+    });
 }
 
 ConstElementPtr
index 5d6325a120144f9591628616f1ec8bd05a0c677d..bff04ca0063cce8c4bdb7266168d188099452f1a 100644 (file)
@@ -540,7 +540,7 @@ protected:
     ///
     /// If there is an error while inserting or updating any of the leases
     /// a warning message is logged and the process continues for the
-    /// remaining leases. The timeout for synchronization is set to 1 minute.
+    /// remaining leases.
     ///
     /// @param http_client reference to the client to be used to communicate
     /// with the other server.
index 1a7e5b0b5d236bf9a63b6cdfd81c47410a71f03b..c82300cd3bbe69417be7e943145721f4e1eb500f 100644 (file)
@@ -896,11 +896,9 @@ Pkt4Ptr IfaceMgr::receive4(uint32_t timeout_sec, uint32_t timeout_usec /* = 0 */
     boost::scoped_ptr<SocketInfo> candidate;
     IfacePtr iface;
     fd_set sockets;
-    fd_set write_sockets;
     int maxfd = 0;
 
     FD_ZERO(&sockets);
-    FD_ZERO(&write_sockets);
 
     /// @todo: marginal performance optimization. We could create the set once
     /// and then use its copy for select(). Please note that select() modifies
@@ -924,17 +922,6 @@ Pkt4Ptr IfaceMgr::receive4(uint32_t timeout_sec, uint32_t timeout_usec /* = 0 */
     if (!callbacks_.empty()) {
         BOOST_FOREACH(SocketCallbackInfo s, callbacks_) {
             FD_SET(s.socket_, &sockets);
-
-            // Sometimes we want to react to socket writes, not only to reads.
-            // However, current use cases are limited to CommandMgr which
-            // doesn't trigger any callbacks. For all use cases that install
-            // callbacks we don't react to socket reads being afraid what we
-            // can break.
-            /// @todo This whole solution is temporary and implemented for
-            /// #5649.
-            if (!s.callback_) {
-                FD_SET(s.socket_, &write_sockets);
-            }
             if (maxfd < s.socket_) {
                 maxfd = s.socket_;
             }
@@ -948,7 +935,7 @@ Pkt4Ptr IfaceMgr::receive4(uint32_t timeout_sec, uint32_t timeout_usec /* = 0 */
     // zero out the errno to be safe
     errno = 0;
 
-    int result = select(maxfd + 1, &sockets, &write_sockets, NULL, &select_timeout);
+    int result = select(maxfd + 1, &sockets, NULL, NULL, &select_timeout);
 
     if (result == 0) {
         // nothing received and timeout has been reached
@@ -1019,11 +1006,9 @@ Pkt6Ptr IfaceMgr::receive6(uint32_t timeout_sec, uint32_t timeout_usec /* = 0 */
 
     boost::scoped_ptr<SocketInfo> candidate;
     fd_set sockets;
-    fd_set write_sockets;
     int maxfd = 0;
 
     FD_ZERO(&sockets);
-    FD_ZERO(&write_sockets);
 
     /// @todo: marginal performance optimization. We could create the set once
     /// and then use its copy for select(). Please note that select() modifies
@@ -1048,17 +1033,6 @@ Pkt6Ptr IfaceMgr::receive6(uint32_t timeout_sec, uint32_t timeout_usec /* = 0 */
         BOOST_FOREACH(SocketCallbackInfo s, callbacks_) {
             // Add it to the set as well
             FD_SET(s.socket_, &sockets);
-
-            // Sometimes we want to react to socket writes, not only to reads.
-            // However, current use cases are limited to CommandMgr which
-            // doesn't trigger any callbacks. For all use cases that install
-            // callbacks we don't react to socket reads being afraid what we
-            // can break.
-            /// @todo This whole solution is temporary and implemented for
-            /// #5649.
-            if (!s.callback_) {
-                FD_SET(s.socket_, &write_sockets);
-            }
             if (maxfd < s.socket_) {
                 maxfd = s.socket_;
             }
@@ -1072,7 +1046,7 @@ Pkt6Ptr IfaceMgr::receive6(uint32_t timeout_sec, uint32_t timeout_usec /* = 0 */
     // zero out the errno to be safe
     errno = 0;
 
-    int result = select(maxfd + 1, &sockets, &write_sockets, NULL, &select_timeout);
+    int result = select(maxfd + 1, &sockets, NULL, NULL, &select_timeout);
 
     if (result == 0) {
         // nothing received and timeout has been reached