Skip to content

Commit fe8c958

Browse files
authored
Added separate exception for the case when it should be conference expiration and then re-request allocation for endpoint when allocation is failed with error of already existed conference which can happen after jicofo restart. Moved the logging level to WARN for such case. (#1005)
1 parent 355308b commit fe8c958

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/ColibriV2SessionManager.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,12 @@ class ColibriV2SessionManager(
368368
try {
369369
return handleResponse(response, session, created, participantInfo)
370370
} catch (e: Exception) {
371-
logger.error("Failed to allocate a colibri2 endpoint for ${participantInfo.id}: ${e.message}")
371+
if (e is ConferenceAlreadyExistsException) {
372+
logger.warn("Failed to allocate a colibri2 endpoint for ${participantInfo.id}: ${e.message}")
373+
} else {
374+
logger.error("Failed to allocate a colibri2 endpoint for ${participantInfo.id}: ${e.message}")
375+
}
376+
372377
if (e is ColibriAllocationFailedException && e.removeBridge) {
373378
// Add participantInfo just in case it wasn't there already (the set will take care of dups).
374379
val removedParticipants = removeSession(session) + participantInfo
@@ -443,6 +448,10 @@ class ColibriV2SessionManager(
443448
"XMPP error: ${response.error?.toXML()}",
444449
true
445450
)
451+
} else if (reason == Colibri2Error.Reason.CONFERENCE_ALREADY_EXISTS) {
452+
// The conference on the bridge already exists. The state between jicofo and the bridge
453+
// is out of sync.
454+
throw ConferenceAlreadyExistsException("Conference already exists error", true)
446455
} else {
447456
// An error coming from the bridge. The state between jicofo and the bridge must be out of sync.
448457
// It's not clear how to handle this. Ideally we should expire the conference and retry, but

jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/Exceptions.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ package org.jitsi.jicofo.bridge.colibri
1818
/** Bridge selection failed, i.e. there were no bridges available. */
1919
class BridgeSelectionFailedException : Exception("Bridge selection failed")
2020

21-
class ColibriAllocationFailedException(
21+
open class ColibriAllocationFailedException(
2222
message: String = "",
2323
val removeBridge: Boolean = false
2424
) : Exception(message)
25+
26+
class ConferenceAlreadyExistsException(
27+
message: String,
28+
removeBridge: Boolean
29+
) : ColibriAllocationFailedException(message, removeBridge)

jicofo/src/main/java/org/jitsi/jicofo/conference/ParticipantInviteRunnable.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ private void doRun()
214214
cancel();
215215
return;
216216
}
217+
catch (ConferenceAlreadyExistsException e)
218+
{
219+
logger.warn("Can not allocate colibri channels, conference already exists.");
220+
cancel();
221+
return;
222+
}
217223
catch (ColibriAllocationFailedException e)
218224
{
219225
logger.error("Failed to allocate colibri channels", e);

0 commit comments

Comments
 (0)