diff --git a/srtcore/group.cpp b/srtcore/group.cpp index c5d9d10f6..fd4e0ba0d 100644 --- a/srtcore/group.cpp +++ b/srtcore/group.cpp @@ -1440,7 +1440,7 @@ int CUDTGroup::sendBroadcast(const char* buf, int len, SRT_MSGCTRL& w_mc) if (!pendingSockets.empty() || nblocked) { - HLOGC(gslog.Debug, log << "grp/sendBroadcast: found pending sockets, polling them."); + HLOGC(gslog.Debug, log << "grp/sendBroadcast: found pending sockets (blocked: " << nblocked << "), polling them."); // These sockets if they are in pending state, they should be added to m_SndEID // at the connecting stage. @@ -3449,11 +3449,13 @@ void CUDTGroup::sendBackup_RetryWaitBlocked(SendBackupCtx& w_sendBackupCtx // Note: A link is added in unstableLinks if sending has failed with SRT_ESYNCSND. const unsigned num_unstable = w_sendBackupCtx.countMembersByState(BKUPST_ACTIVE_UNSTABLE); const unsigned num_wary = w_sendBackupCtx.countMembersByState(BKUPST_ACTIVE_UNSTABLE_WARY); - if ((num_unstable + num_wary == 0) || !w_none_succeeded) + const unsigned num_pending = w_sendBackupCtx.countMembersByState(BKUPST_PENDING); + if ((num_unstable + num_wary + num_pending == 0) || !w_none_succeeded) return; HLOGC(gslog.Debug, log << "grp/sendBackup: no successfull sending: " - << (num_unstable + num_wary) << " unstable links - waiting to retry sending..."); + << (num_unstable + num_wary) << " unstable links, " + << num_pending << " pending - waiting to retry sending..."); // Note: GroupLock is set already, skip locks and checks getGroupData_LOCKED((w_mc.grpdata), (&w_mc.grpdata_size)); diff --git a/test/test_bonding.cpp b/test/test_bonding.cpp index 7beb75974..c261725f3 100644 --- a/test/test_bonding.cpp +++ b/test/test_bonding.cpp @@ -764,6 +764,8 @@ TEST(Bonding, ConnectNonBlocking) auto acthr = std::thread([&lsn_eid]() { SRT_EPOLL_EVENT ev[3]; + ThreadName::set("TEST_A"); + cout << "[A] Waiting for accept\n"; // This can wait in infinity; worst case it will be killed in process. @@ -814,7 +816,9 @@ TEST(Bonding, ConnectNonBlocking) int result = srt_connect_group(ss, cc, 2); ASSERT_EQ(result, 0); char data[4] = { 1, 2, 3, 4}; + cout << "Sending...\n"; int wrong_send = srt_send(ss, data, sizeof data); + cout << "Getting error...\n"; int errorcode = srt_getlasterror(NULL); EXPECT_EQ(wrong_send, -1); EXPECT_EQ(errorcode, SRT_EASYNCSND) << "REAL ERROR: " << srt_getlasterror_str();