edges try to reconnect to a non-existing stream on Origin and never end

Hi

I start origin-edge servers and customize my own resolveStreamAlias() @ edge to convert stream url on Origin. I found if what the player subscribes is a non-existing stream on Origin then the Edge server would retry to connect again and again, it never stops even the player disconnects from edge.

The log:

LiveMediaStreamReceiver.doWatchdog: streamTimeout[live-origin/_definst_/mystream_aac]: Resetting connection: wowz://<origin>:1935/live-origin/_definst_/mystream_aacLiveMediaStreamReceiver.resetConnection: (SOCKET, R: /<origin>:1935, L: /172.31.26.6:37824, S: /<origin>:1935)
LiveMediaStreamReceiver.sessionClosed: 	
LiveMediaStreamReceiver.sessionClosed: reconnect: isCurrentSession:false tryConnect:true
LiveMediaStreamReceiver.doWatchdog: streamTimeout[live-origin/_definst_/mystream_aac]: Resetting connection: wowz://<origin>:1935/live-origin/_definst_/mystream_aac
LiveMediaStreamReceiver.resetConnection: (SOCKET, R: /<origin>:1935, L: /172.31.26.6:37825, S: /<origin>:1935)
LiveMediaStreamReceiver.sessionClosed:
LiveMediaStreamReceiver.sessionClosed: reconnect: isCurrentSession:false tryConnect:true
LiveMediaStreamReceiver.doWatchdog: streamTimeout[live-origin/_definst_/mystream_aac]: Resetting connection: wowz://<origin>:1935/live-origin/_definst_/mystream_aac

I saw the similar post here and here but no clear comments to fix that.

I help the edge server could stop the retry once the player disconnects from edge, how could I do?

andy_c

Hi Andy,

If the application stream type is liverepeater-edge then the player connections should control the starting and stopping of the mediaCasters. If there is a player trying to start the stream then the mediaCaster will continue to try to connect. You should disconnect all of the players to let the mediaCaster shut down on it’s own.

If you are starting the mediaCaster manually using the api methods or stream manager etc then you can use the IMediaCasterNotify2 interface. Each time a mediaCaster tries to connect or reconnect, it will call onConnectStart. When it has a successful connection, it will call onConnectSuccess and will call onStreamStart when the stream starts. If the connection failed to connect to the remote server then it will call onConnectFailure

When it resets, it will call onStreamStop if the stream actually started and then onConnectStart again. If the stream never started then it will just call onConnectStart.

You should always return a valid url from resolveStreamAlias. By the time this is called, the mediaCaster is already created and is looking for the url to connect to.

You can return null from resolvePlayAlias to prevent the player from playing back a stream and from starting the mediaCaster. You could validate the player request here and only return the stream name if the request is for a valid stream.

Roger.

Hi Andy,

When you start the mediaCaster manually, it will continue to try to connect until you shut it down. Any second call to start a mediaCaster that is already running will be ignored.

You can query the origin server(s) anyway you like. You will have to have something running on them to process the request as there isn’t anything built in.

Roger.

Hi Roger,

Starting the mediaCaster manually is a very good choice for me. Now I have already applied it. Could you share more information on :

  1. Suppose the source stream already connects to origin server, do I need to retry the connect (for example, retry 3 times) on edge to handle origin busy then no response case?

  2. If the Q1’s answer is ‘Yes’, when I count down the retry-count on onConnectFailure, how do I close the retry and tell player ‘stream not exist’ (I don’t want player to wait anymore) ?

  3. If the Q1’s answer is ‘No’, I suppose I should query origin server on resolvePlayAlias to know whether the require stream exist, how to do it?

Thanks again for your helpful answer

andy_c