Changeset 5860
- Timestamp:
- Aug 11, 2009, 1:47:47 PM (15 years ago)
- Location:
- source/ariba
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/communication/networkinfo/NetworkInformation.cpp
r5638 r5860 91 91 logging_error( "getting interface list failed with: " << 92 92 strerror(errno)); 93 94 // if the socket is bogus, try to get 95 // a new one for the next call 96 if(errno == EBADF){ 97 close( infoSocket ); 98 infoSocket = socket( AF_INET, SOCK_DGRAM, 0 ); 99 } 100 93 101 return retlist; 94 102 } -
source/ariba/overlay/BaseOverlay.cpp
r5838 r5860 377 377 378 378 // bootstrap against ourselfs 379 logging_ debug("joining spovnet locally");379 logging_info("joining spovnet locally"); 380 380 381 381 overlayInterface->joinOverlay(); … … 394 394 395 395 // bootstrap against another node 396 logging_ debug("joining spovnet remotely against " << bootstrapEp.toString());396 logging_info("joining spovnet remotely against " << bootstrapEp.toString()); 397 397 398 398 const LinkID& lnk = bc->establishLink( bootstrapEp ); … … 1098 1098 // inform all registered services of the event 1099 1099 BOOST_FOREACH( NodeListener* i, nodeListeners ) 1100 i->onJoinFailed( spovnetId );1100 i->onJoinFailed( spovnetId ); 1101 1101 1102 1102 delete replyMsg; … … 1110 1110 overlayInterface->joinOverlay( replyMsg->getBootstrapEndpoint() ); 1111 1111 1112 //record bootstrap ep as good endpoint to join1113 overlayBootstrap.recordJoin( replyMsg->getBootstrapEndpoint() );1114 1115 1112 // update ovlvis 1116 1113 //ovl.visChangeNodeColor( ovlId, nodeId, OvlVis::NODE_COLORS_GREEN); … … 1120 1117 i->onJoinCompleted( spovnetId ); 1121 1118 1122 delete replyMsg;1123 1124 1119 } else { 1125 1120 … … 1128 1123 overlayInterface->joinOverlay( replyMsg->getBootstrapEndpoint() ); 1129 1124 1130 delete replyMsg;1131 1132 1125 } // if( overlayInterface == NULL ) 1133 1126 1127 //record bootstrap ep as good endpoint to join 1128 overlayBootstrap.recordJoin( replyMsg->getBootstrapEndpoint() ); 1129 1130 delete replyMsg; 1134 1131 ret = true; 1135 1132 break; -
source/ariba/overlay/OverlayBootstrap.cpp
r5838 r5860 88 88 89 89 void OverlayBootstrap::handleSystemEvent(const SystemEvent& event){ 90 EventData* data = event.getData<EventData>();90 JoinData* data = event.getData<JoinData>(); 91 91 92 92 // announcement for our spovnet … … 129 129 // 130 130 131 EventData* data = new EventData();131 JoinData* data = new JoinData(); 132 132 data->spovnetid = sid; 133 133 data->nodeid = nid; … … 154 154 boost::mutex::scoped_lock lock(lastJoinesMutex); 155 155 156 EventData data;156 JoinData data; 157 157 data.spovnetid = spovnetid; 158 158 data.nodeid = nodeid; 159 159 data.endpoint = _ep; 160 160 161 lastJoines.push_front(JoinData(data)); 161 logging_info("recording bootstrap information " << data.endpoint.toString()); 162 163 lastJoines.push_front(data); 162 164 } 163 165 … … 175 177 // we have overlay neighbors -> ok 176 178 if(overlay->getOverlayNeighbors().size() > 0) return; 179 180 logging_info("overlay not joined, checking for earlier used bootstrap information"); 181 EndpointDescriptor joinep = EndpointDescriptor::UNSPECIFIED(); 177 182 178 183 // no overlay neighbors -> try out already … … 185 190 186 191 // use last used element and then put it into back 187 JoinData data = *i; 188 lastJoines.pop_front(); 189 lastJoines.push_back(data); 192 joinep = (*i).endpoint; 193 194 if(lastJoines.size() >= 2) 195 swap( *lastJoines.begin(), *(--(lastJoines.end())) ); 190 196 } 191 197 192 logging_info("no overlay connections detected, " << 193 "trying to join using old bootstrap information"); 198 logging_info("no overlay conenctivity detected, " << 199 "trying to join using old bootstrap information: " << 200 joinep.toString()); 194 201 195 202 // try to join using this node, if the join is successfull 196 203 // the endpoint will again be inserted using recordJoin 197 overlay->joinSpoVNet( spovnetid, data.data.endpoint);204 overlay->joinSpoVNet( spovnetid, joinep ); 198 205 } 199 206 … … 202 209 203 210 void OverlayBootstrap::WatchdogTimer::startWatchdog(){ 204 Timer::setInterval( 2000);211 Timer::setInterval(5000); 205 212 Timer::start(); 206 213 } -
source/ariba/overlay/OverlayBootstrap.h
r5838 r5860 44 44 #include <ctime> 45 45 #include <deque> 46 #include <algorithm> 46 47 #include <boost/thread/mutex.hpp> 47 48 #include "ariba/utility/logging/Logging.h" … … 56 57 #include "ariba/utility/system/SystemEventType.h" 57 58 59 using std::swap; 58 60 using std::deque; 59 61 using std::string; … … 94 96 95 97 private: 96 class EventData {98 class JoinData { 97 99 public: 100 JoinData() : spovnetid(), nodeid(), endpoint() { 101 } 102 103 JoinData& operator=( const JoinData& rhs) { 104 spovnetid = rhs.spovnetid; 105 nodeid = rhs.nodeid; 106 endpoint = rhs.endpoint; 107 } 108 98 109 SpoVNetID spovnetid; 99 110 NodeID nodeid; … … 106 117 BaseOverlay* overlay; 107 118 string randname; 108 109 class JoinData {110 public:111 time_t timestamp;112 EventData data;113 114 JoinData(const EventData& _data){115 timestamp = time(NULL);116 data = _data;117 }118 119 JoinData(){120 timestamp = time(NULL);121 }122 };123 119 124 120 class WatchdogTimer : public Timer {
Note:
See TracChangeset
for help on using the changeset viewer.