Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout for colibri endpoint allocation too small, unconfigurable #1198

Open
micha030201 opened this issue Dec 5, 2024 · 0 comments
Open

Comments

@micha030201
Copy link

Description

On my self-hosted setup, colibri endpoint allocation occasionally takes over 5 seconds, causing jicofo to timeout and drop the bridge. This leads to sporadic failures when starting a conference -- starting it a second or third time sometimes fixes the issue if the colibri endpoint is allocated quickly enough.

Current behavior

Relevant part of the jicofo log
Jicofo 2024-12-04 12:17:18.808 SEVERE: [130] [[email protected] meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4] ColibriV2SessionManager.allocate#397: Failed to allocate a colibri2 endpoint for d01221d8: Timeout
Jicofo 2024-12-04 12:17:20.188 INFO: [131] [[email protected] meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4] ColibriV2SessionManager.allocate#378: Ignoring response for a session that's no longer active ([email protected]/157354f3-2348-498b-bc9b-e0bd05258b5b)
Jicofo 2024-12-04 12:17:20.214 SEVERE: [131] [[email protected] meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4 participant=6a63fefa] ParticipantInviteRunnable.doRun#230: Failed to allocate colibri channels
org.jitsi.jicofo.bridge.colibri.ColibriAllocationFailedException: Session no longer active ([email protected]/157354f3-2348-498b-bc9b-e0bd05258b5b)
        at org.jitsi.jicofo.bridge.colibri.ColibriV2SessionManager.allocate(ColibriV2SessionManager.kt:379)
        at org.jitsi.jicofo.conference.ParticipantInviteRunnable.doRun(ParticipantInviteRunnable.java:214)
        at org.jitsi.jicofo.conference.ParticipantInviteRunnable.run(ParticipantInviteRunnable.java:153)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
Jicofo 2024-12-04 12:17:20.803 INFO: [128] [[email protected] meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4] JitsiMeetConferenceImpl$ColibriSessionManagerListener.bridgeRemoved#2513: Bridge Bridge[[email protected]/157354f3-2348-498b-bc9b-e0bd05258b5b, version=2.3.168-g28674f78, relayId=null, region=null, stress=0.02] was removed from the conference. Re-inviting its participants: [d01221d8, 6a63fefa]
Jicofo 2024-12-04 12:17:20.823 SEVERE: [130] [[email protected] meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4 participant=d01221d8] ParticipantInviteRunnable.doRun#230: Failed to allocate colibri channels
org.jitsi.jicofo.bridge.colibri.ColibriAllocationFailedException: Timeout
        at org.jitsi.jicofo.bridge.colibri.ColibriV2SessionManager.handleResponse(ColibriV2SessionManager.kt:436)
        at org.jitsi.jicofo.bridge.colibri.ColibriV2SessionManager.allocate(ColibriV2SessionManager.kt:392)
        at org.jitsi.jicofo.conference.ParticipantInviteRunnable.doRun(ParticipantInviteRunnable.java:214)
        at org.jitsi.jicofo.conference.ParticipantInviteRunnable.run(ParticipantInviteRunnable.java:153)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
Jicofo 2024-12-04 12:17:21.452 INFO: [131] [[email protected] meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4] ColibriV2SessionManager.allocate#281: Allocating for 6a63fefa
Jicofo 2024-12-04 12:17:21.453 INFO: [130] [[email protected] meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4] ColibriV2SessionManager.allocate#281: Allocating for d01221d8
Jicofo 2024-12-04 12:17:21.507 WARNING: [131] BridgeSelector.selectBridge#182: There are no operational bridges.
Jicofo 2024-12-04 12:17:21.538 WARNING: [130] BridgeSelector.selectBridge#182: There are no operational bridges.
Jicofo 2024-12-04 12:17:21.539 SEVERE: [131] [[email protected] meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4 participant=6a63fefa] ParticipantInviteRunnable.doRun#218: Can not invite participant, no bridge available.
Jicofo 2024-12-04 12:17:21.576 SEVERE: [130] [[email protected] meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4 participant=d01221d8] ParticipantInviteRunnable.doRun#218: Can not invite participant, no bridge available.

(room name, domain, and external IP address redacted to roomname, redacted.domain and 123.123.123.123 respectively)

Corresponding part of the JVB log
JVB 2024-12-04 12:17:06.655 INFO: [5203] Videobridge.createConference#213: create_conf, id=bec0144cee5be4a0 meeting_id=d4e34611-0d36-4f51-94cb-09478a70abd4
JVB 2024-12-04 12:17:12.894 INFO: [5206] [confId=bec0144cee5be4a0 [email protected] meeting_id=d4e34611] Conference.lambda$new$1#227: RECV colibri2 request: <iq xmlns="jabber:client" to="[email protected]/0X-W8fniNZwH" from="[email protected]/focus" id="anZiQGF1dGguaml0c2kuZWxlcmdhcmQucG9sYXJvcmJpdC5zcGFjZS8wWC1XOGZuaU5ad0gAOVdVMVgtMTQ1AIXVxt8+ZalJ" type="get"><conference-modify xmlns="jitsi:colibri2" meeting-id="d4e34611-0d36-4f51-94cb-09478a70abd4" name="[email protected]" rtcstats-enabled="false" create="true"><endpoint create="true" stats-id="Lea-UrM" id="d01221d8"><media type="audio"><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" channels="2" id="111" name="opus" clockrate="48000"><parameter name="minptime" value="10"/><parameter name="useinbandfec" value="1"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="telephone-event" clockrate="8000" id="126"/><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="urn:ietf:params:rtp-hdrext:ssrc-audio-level" id="1"/><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01" id="5"/><extmap-allow-mixed xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"/></media><media type="video"><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="AV1" clockrate="90000" id="41"><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="VP8" clockrate="90000" id="100"><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="H264" clockrate="90000" id="107"><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/><parameter name="profile-level-id" value="42e01f;level-asymmetry-allowed=1;packetization-mode=1;"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="VP9" clockrate="90000" id="101"><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="rtx" clockrate="90000" id="42"><parameter name="apt" value="41"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="rtx" clockrate="90000" id="96"><parameter name="apt" value="100"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="rtx" clockrate="90000" id="97"><parameter name="apt" value="101"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="rtx" clockrate="90000" id="99"><parameter name="apt" value="107"/></payload-type><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension" id="11"/><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time" id="3"/><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01" id="5"/><extmap-allow-mixed xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"/></media><transport ice-controlling="true"><sctp/></transport><sources/><capability name="source-names"/><capability name="ssrc-rewriting"/></endpoint></conference-modify></iq>
JVB 2024-12-04 12:17:14.256 INFO: [5206] [confId=bec0144cee5be4a0 [email protected] meeting_id=d4e34611 epId=d01221d8 local_ufrag=67ikt1ie8pko6u ufrag=67ikt1ie8pko6u] Agent.gatherCandidates#637: Gathering candidates for component stream.RTP.
JVB 2024-12-04 12:17:16.313 INFO: [5206] [confId=bec0144cee5be4a0 [email protected] meeting_id=d4e34611 epId=d01221d8] Endpoint.<init>#386: Created new endpoint, iceControlling=true
JVB 2024-12-04 12:17:17.875 WARNING: [5206] [confId=bec0144cee5be4a0 [email protected] meeting_id=d4e34611] Conference.lambda$new$1#251: Took 4865 ms to process an IQ (total delay 13620 ms): <iq xmlns="jabber:client" to="[email protected]/0X-W8fniNZwH" from="[email protected]/focus" id="anZiQGF1dGguaml0c2kuZWxlcmdhcmQucG9sYXJvcmJpdC5zcGFjZS8wWC1XOGZuaU5ad0gAOVdVMVgtMTQ1AIXVxt8+ZalJ" type="get"><conference-modify xmlns="jitsi:colibri2" meeting-id="d4e34611-0d36-4f51-94cb-09478a70abd4" name="[email protected]" rtcstats-enabled="false" create="true"><endpoint create="true" stats-id="Lea-UrM" id="d01221d8"><media type="audio"><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" channels="2" id="111" name="opus" clockrate="48000"><parameter name="minptime" value="10"/><parameter name="useinbandfec" value="1"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="telephone-event" clockrate="8000" id="126"/><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="urn:ietf:params:rtp-hdrext:ssrc-audio-level" id="1"/><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01" id="5"/><extmap-allow-mixed xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"/></media><media type="video"><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="AV1" clockrate="90000" id="41"><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="VP8" clockrate="90000" id="100"><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="H264" clockrate="90000" id="107"><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/><parameter name="profile-level-id" value="42e01f;level-asymmetry-allowed=1;packetization-mode=1;"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="VP9" clockrate="90000" id="101"><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="transport-cc"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="rtx" clockrate="90000" id="42"><parameter name="apt" value="41"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="rtx" clockrate="90000" id="96"><parameter name="apt" value="100"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="rtx" clockrate="90000" id="97"><parameter name="apt" value="101"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="fir" type="ccm"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" type="nack"/><rtcp-fb xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0" subtype="pli" type="nack"/></payload-type><payload-type xmlns="urn:xmpp:jingle:apps:rtp:1" name="rtx" clockrate="90000" id="99"><parameter name="apt" value="107"/></payload-type><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension" id="11"/><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time" id="3"/><rtp-hdrext xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0" uri="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01" id="5"/><extmap-allow-mixed xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"/></media><transport ice-controlling="true"><sctp/></transport><sources/><capability name="source-names"/><capability name="ssrc-rewriting"/></endpoint></conference-modify></iq>
JVB 2024-12-04 12:17:17.896 INFO: [5206] [confId=bec0144cee5be4a0 [email protected] meeting_id=d4e34611] Conference.lambda$new$1#254: SENT colibri2 response: <iq xmlns='jabber:client' to='[email protected]/focus' from='[email protected]/0X-W8fniNZwH' id='anZiQGF1dGguaml0c2kuZWxlcmdhcmQucG9sYXJvcmJpdC5zcGFjZS8wWC1XOGZuaU5ad0gAOVdVMVgtMTQ1AIXVxt8+ZalJ' type='result'><conference-modified xmlns='jitsi:colibri2'><endpoint id='d01221d8'><transport><transport xmlns='urn:xmpp:jingle:transports:ice-udp:1' pwd='10vt4nu4jfm8raehg79o61fcpm' ufrag='67ikt1ie8pko6u'><rtcp-mux/><fingerprint xmlns='urn:xmpp:jingle:apps:dtls:0' setup='actpass' hash='sha-256'>9D:9F:06:0E:D6:15:DC:F3:68:7A:FD:03:C4:46:85:69:F4:34:DF:2B:36:9D:DB:19:EA:78:2B:5F:A0:E4:25:F6</fingerprint><web-socket xmlns='http://jitsi.org/protocol/colibri' url='wss://redacted.domain:443/colibri-ws/default-id/bec0144cee5be4a0/d01221d8?pwd=10vt4nu4jfm8raehg79o61fcpm'/><candidate component='1' foundation='1' generation='0' id='44105b224cf87ac90ffffffff8764a19b' network='0' priority='2130706431' protocol='udp' type='host' ip='10.11.0.2' port='10000'/><candidate component='1' foundation='2' generation='0' id='78204e484cf87ac90ffffffff8761a19a' network='0' priority='2130706431' protocol='udp' type='host' ip='10.8.0.1' port='10000'/><candidate component='1' foundation='3' generation='0' id='24bf94944cf87ac903e01c177' network='0' priority='2113932031' protocol='udp' type='host' ip='192.168.31.222' port='10000'/><candidate component='1' foundation='4' generation='0' id='6230126a4cf87ac90ffffffffdcf3f9e0' network='0' priority='1677724415' protocol='udp' type='srflx' ip='123.123.123.123' port='10000' rel-addr='192.168.31.222' rel-port='10000'/></transport><sctp role='server' port='5000'/></transport></endpoint><sources><media-source type='audio' id='jvb-a0'><source xmlns='urn:xmpp:jingle:apps:rtp:ssma:0' ssrc='3973680167' name='jvb-a0'/></media-source><media-source type='video' id='jvb-v0'><source xmlns='urn:xmpp:jingle:apps:rtp:ssma:0' ssrc='3263014397' name='jvb-v0'/></media-source></sources></conference-modified></iq>

(room name, domain, and external IP address redacted to roomname, redacted.domain and 123.123.123.123 respectively)

As you can see, colibri endpoint allocation takes too long, so jicofo gives up waiting for it. After that, it removes the bridge from the meeting, and because this is the only bridge that I have, the meeting dies and has to be restarted.

Expected Behavior

I would like to adjust the timeout in jicofo so that it doesn't give up waiting for the colibri endpoint too early.

Possible Solution

The part that waits for the allocation request is here:

stanzaCollector gets created earlier:

stanzaCollector = session.sendAllocationRequest(participantInfo)

Here is the function that does that:

/** Creates and sends a request to allocate a new endpoint. Returns a [StanzaCollector] for the response. */
internal fun sendAllocationRequest(participant: ParticipantInfo): StanzaCollector {
val request = createRequest(!created)
val endpoint = participant.toEndpoint(create = true, expire = false).apply {
if (participant.audioMuted || participant.videoMuted) {
setForceMute(participant.audioMuted, participant.videoMuted)
}
if (participant.visitor) {
setMucRole(MUCRole.visitor)
}
setTransport(
Transport.getBuilder().apply {
// TODO: we're hard-coding the role here, and it must be consistent with the role signaled to the
// client. Signaling inconsistent roles leads to hard to debug issues (e.g. sporadic ICE/DTLS
// failures with firefox but not chrome).
setIceControlling(true)
if (participant.useSctp) {
setSctp(Sctp.Builder().build())
}
}.build()
)
}
participant.medias.forEach { endpoint.addMedia(it) }
request.addEndpoint(endpoint.build())
logger.trace { "Sending allocation request for ${participant.id}: ${request.build().toStringOpt()}" }
created = true
return xmppConnection.createStanzaCollectorAndSend(request.build())
}

The nextResult function is documented here. It uses the default connection (AbstractXMPPConnection) timeout that is initialized through SmackConfiguration to be 5 seconds. A timeout of 5 seconds is roughly consistent with what I am observing in the logs.

The way to change it is to either call nextResult with a timeout parameter or to setReplyTimeout on the xmppConnection object, neither of which jicofo currently does.

There seems to be a config option for it, but apparently it is not used in this case:

// How long to wait for a response to a stanza before giving up.
reply-timeout = 15 seconds

I may have missed something in the analysys above, in which case I apologize -- I have only taken a cursory look and I don't use Java/Kotlin much.

The best solution to me appears to be to setReplyTimeout on xmppConnection in ColibriV2SessionManager with the timeout value from the config, but maybe I am missing some system design details here.

Steps to reproduce

I honestly don't know what causes the endpoint allocation to be slow -- I noticed that the colibri reply lists all of the server's IP addresses, so it may be because my server has multiple of them (I'm doing VPN shenanigans), or just because it hits some sort of IO bottleneck (I'm running off of an HDD). If you want to reproduce it, adding sleep(5000) in the part of JVB (?) that creates the colibri endpoint should probably do it. I don't know where that part of code is.

Environment details

I followed the Self-Hosting Guide - Debian/Ubuntu server on Debian Bookworm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant