You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
"Abandoned" pipeline is seemingly not released under certain circumstances
Context
Good scenario:
Node JS app controls KMS via WS
A "sendonly" video session is opened from a browser towards KMS via Node JS app
Pipeline handle can be obtained by "kurentoClient.getServerManager().getPipelines()" (pseudo code)
If the browser window is closed (w/o doing any pipeline.release()) a couple of seconds later the WebRTCEndpoint as observed by the Node JS app reports a "MediaStateChange" from CONNECTED to DISCONNECTED, the pipeline is released manually and disappears from the report
The "getPipelines()" reports an empty array, as expected
Bad scenario (and root of this bug report):
Node JS app controls KMS via WS
A "sendonly" video session is opened from a browser towards KMS via Node JS app
Pipeline handle can be obtained by "kurentoClient.getServerManager().getPipelines()" (pseudo code)
The Node JS app is terminated, followed by a termination of the browser. Nobody releases the pipeline manually
When the Node JS app returns, it still finds the pipeline as reported above and this pipeline never disappears from the list, even though the garbage collector runs several times on KMS
It is still possible to release this pipeline then "manually", but this is not such a good solution, because nothing indicates the stale character of this session
How to reproduce?
On a machine with standard KMS installation:
mkdir test && cd test
npm init --yes
npm i kurento-client
nano index.js
Copy the test app below into index.js and save
node index.js
After 5 seconds and then every 5 seconds you should see a list of pipeline IDs. Close the node app, reopen it. With every new reopen the list of pipeline IDs grows w/o being automatically disposed somewhen.
The test code:
constkurento=require('kurento-client')consttest=async()=>{try{letkurentoClient=awaitkurento('ws://localhost:8888/kurento',{failAfter: 5})letkurentoServerManager=awaitkurentoClient.getServerManager()setInterval(async()=>{try{letpipelines=awaitkurentoServerManager.getPipelines()console.log(pipelines.map(pipeline=>pipeline.id))}catch(e){console.error(e.message)}},5000)letpipeline=awaitkurentoClient.create('MediaPipeline')letwebRtcEndpoint=awaitpipeline.create('WebRtcEndpoint')webRtcEndpoint.on('ConnectionStateChanged',(event)=>{console.log(`ConnectionStateChanged ${JSON.stringify(event)}`)})webRtcEndpoint.on('MediaStateChanged',(event)=>{console.log(`MediaStateChanged ${JSON.stringify(event)}`)})webRtcEndpoint.on('IceComponentStateChange',(event)=>{console.log(`IceComponentStateChange state ${event.state}, streamId ${event.streamId}, componentId ${event.componentId}`)})webRtcEndpoint.on('NewCandidatePairSelected',(event)=>{console.log(`NewCandidatePairSelected, server ${event.candidatePair.localCandidate}`)console.log(`NewCandidatePairSelected, client ${event.candidatePair.remoteCandidate}`)})webRtcEndpoint.on('IceCandidateFound',(event)=>{console.log(`IceCandidateFound ${event.candidate.candidate}, sdpMid: ${event.candidate.sdpMid}`)})webRtcEndpoint.on('IceGatheringDone',(event)=>{console.log(`IceGatheringDone`)})awaitwebRtcEndpoint.connect(webRtcEndpoint)console.log(awaitwebRtcEndpoint.generateOffer())awaitwebRtcEndpoint.gatherCandidates()}catch(e){console.error(e)}}test()
Expected & current behavior
The pipeline should be released somewhen automatically. There is no RTP stream, which feeds it anymore, shouldn't this pipeline be abandoned automatically somewhen by KMS?
All pipelines are gone (of course) with a restart of KMS
Kurento Media Server version: 6.16.1~7.g3f39a10
Found modules:
'core' version 6.16.1~11.g2007dd8e
'elements' version 6.16.1~16.g7a1ae52
'filters' version 6.16.1~2.g1ea55c4
Hello @neilyoung! 👋 we're sorry you found a bug... so first of all, thank you very much for reporting it.
To know about progress, check in Triage. All issues are considered Backlog Candidates until work priorities align and the issue is selected for development. It will then become part of our official Backlog.
Prerequisites
These are MANDATORY, otherwise the issue will be automatically closed.
Issue description
"Abandoned" pipeline is seemingly not released under certain circumstances
Context
Good scenario:
Bad scenario (and root of this bug report):
How to reproduce?
On a machine with standard KMS installation:
mkdir test && cd test
npm init --yes
npm i kurento-client
nano index.js
node index.js
After 5 seconds and then every 5 seconds you should see a list of pipeline IDs. Close the node app, reopen it. With every new reopen the list of pipeline IDs grows w/o being automatically disposed somewhen.
The test code:
Expected & current behavior
The pipeline should be released somewhen automatically. There is no RTP stream, which feeds it anymore, shouldn't this pipeline be abandoned automatically somewhen by KMS?
All pipelines are gone (of course) with a restart of KMS
(Optional) Possible solution
Info about your environment
About Kurento Media Server
About your Application Server
About end-user clients
Run these commands
The text was updated successfully, but these errors were encountered: