MCPcopy Create free account
hub / github.com/catboost/catboost / Step

Method Step

library/cpp/netliba/v12/udp_host_connection.h:777–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775 }
776
777 bool Step(const float maxSleepTime, float* maxWaitTime, float* stepDeltaTime, const NHPTimer::STime now, TStatAggregator* failureStat) {
778 const float deltaT = (float)NHPTimer::GetSeconds(now - CurrentTime);
779 *stepDeltaTime = deltaT;
780 CurrentTime = now;
781
782 RecvCompleted.Cleanup(GetGuid());
783
784 if (!IsAlive()) {
785 Y_ASSERT(!PeerLink.IsSleeping());
786 Y_ASSERT(InQueue.Empty() && OutQueue.Empty());
787 return false; // kill me plz!
788
789 } else if (InQueue.Empty() && OutQueue.Empty()) {
790 return PeerLink.Sleep(deltaT, maxSleepTime, maxWaitTime);
791 } else {
792 //If we are here - we must be active. It is important to handle unexpected killed senders, or some
793 //network error
794 Y_ASSERT(IsInactivated() == false);
795 // we had to stop sleeping after inserting new element to Udp(In|Out)Queue
796 if (Y_UNLIKELY(PeerLink.IsSleeping())) {
797 Y_ASSERT(false);
798 PeerLink.MakeAlive(); // not necessary, just to be sure
799 }
800 failureStat->AddPoint(GetFailRate());
801 return PeerLink.Update(deltaT, maxWaitTime);
802 }
803 }
804
805 TPeerLink& GetAlivePeerLink() {
806 PeerLink.MakeAlive();

Callers

nothing calls this directly

Calls 8

GetGuidFunction · 0.85
MakeAliveMethod · 0.80
CleanupMethod · 0.45
IsSleepingMethod · 0.45
EmptyMethod · 0.45
SleepMethod · 0.45
AddPointMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected