awslabs / amazon-kinesis-video-streams-producer-c

https://awslabs.github.io/amazon-kinesis-video-streams-producer-c/group__PublicMemberFunctions.html
Apache License 2.0
55 stars 77 forks source link

[QUESTION] What if ContinuousRetryStreamCallbacks fails #181

Closed Nomidia closed 3 years ago

Nomidia commented 3 years ago

If the network is disconnected when setting the state machine in kinesisVideoStreamResetStream, it may return an error code. After network recovers, the stream state will not restore to streaming.

https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/blob/403c40125f629a37f1b35c5134fa8e5c16f9da30/src/source/ContinuousRetryStreamCallbacks.c#L360

MushMal commented 3 years ago

It is the current design indeed. The question is what can be done in this case? There is a class of errors that the continuous callback will not keep retrying.

Perhaps, this is the time to raise a different type of error for the customers application to simply listen to and do a global reset itself. Need to think a little

Nomidia commented 3 years ago

My question is, if the retry thread has been created, but it fails in continuousRetryStreamRestartHandler, such as kinesisVideoStreamResetStream. In this case, it will stop retrying. Therefore, we need to reset the stream every time the upload is resumed. https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/blob/403c40125f629a37f1b35c5134fa8e5c16f9da30/src/source/ContinuousRetryStreamCallbacks.c#L285

https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/blob/403c40125f629a37f1b35c5134fa8e5c16f9da30/src/source/ContinuousRetryStreamCallbacks.c#L360

MushMal commented 3 years ago

This is my point. We need to enhance the SDK to be able to call the error handler callback with a different error that the application could handle - hence, I added an enhancement tag. Will address this soon.