Open pabloFuente opened 5 years ago
I was able to reproduce this issue, but seems that KMS does actually inform the client app about the error. When the client tries to subscribe to the "Stopped" event of a RecorderEndpoint which doesn't actually exist...
DEBUG KurentoWebSocketTransport WebSocketTransport.cpp:427:processMessage:
Message: {"id":24,"method":"subscribe","params":{"type":"Stopped",
"object":"298bfb63-6d0c-4a01-8fcf-f06d0e8a4b9d_kurento.MediaPipeline/ffe8e125-f95c-4a15-b8c7-0411dcee667d_kurento.RecorderEndpoint",
"sessionId":"b3736a86-6f20-456e-87d3-fc9bdc16990c"},"jsonrpc":"2.0"}
KMS replies with an error event indicating that the object
ffe8e125-f95c-4a15-b8c7-0411dcee667d_kurento.RecorderEndpoint
doesn't exist so the operation failed:
DEBUG KurentoWebSocketTransport WebSocketTransport.cpp:429:processMessage:
Response: {"error":{"code":40101,"data":{"type":"MEDIA_OBJECT_NOT_FOUND"},
"message":"Object '298bfb63-6d0c-4a01-8fcf-f06d0e8a4b9d_kurento.MediaPipeline/ffe8e125-f95c-4a15-b8c7-0411dcee667d_kurento.RecorderEndpoint' not found"},
"id":24,"jsonrpc":"2.0"}
This is not a bug in Kurento Media Server, but a weakness of the Kurento Java client. The client library is blocking the caller app indefinitely while ignoring the error event that KMS sends about an non-existing object ID.
What should happen here is that the client library receives this error, understands that a currently ongoing request is about an object that doesn't exist any more, abort that request, and return control to the caller application.
This means nothing to do in KMS itself, but the mentioned ability needs to be added to the Java client. Adding similar behavior to the JS client would also be a good idea, to keep both clients on par with features.
Summary: When executing some RPC methods over non-existing KMS objects, a response similar to
"Media object not found"
is expected but no response is received at all. This has been encountered for the following methods:RecorderEndpoint.addStoppedListener
RecorderEndpoint.stop
KMS Version:
Other libraries versions:
Client libraries
Browsers tested Not relevant
System description: Simple localhost development setup: KMS and Java client located in the same machine and using localhost ips
What steps will reproduce the problem?
RecorderEndpoint.stop()
orRecorderEndpoint.addStoppedListener()
over the object previously created in point 2. None of those calls will ever return.What is the expected result? An error response stating that certain media object has not been found. For example, performing the exact same steps but calling
WebRtcEndpoint.getName()
in step 4 will in fact return the desired error.What happens instead? No response is recevied at all. In this case by using Kurento Client for Java, the 2 methods stated in the issue will never return and the thread will be blocked