The problem is, if evostream is unable to fetch stream for any reason, we cannot know if evostream server is actively trying to pull it or not as it does not show up in listStreamsIds, getStreamsCount etc. commands. And for this reason, we cannot remove it as well. This is a very critical issue.
That is not accurate. EMS will always try to fulfil the pulls/push, unless instructed otherwise (keepAlive=0). Also, EMS offers listConfig and removeConfig CLI calls. As Bryan said, whenever a pull/push is made, there are 2 entities created.
1. The configuration for that pull/push. You can see it as a blueprint of the future stream. It is accompanied by status fields when listed with listConfig CLI. Also, has an unique id. Do not mix this id with the stream id, they are different.
2. the stream itself. Of course, when the push/pull succeeded. This stream information also has a reference id to the configuration, so they can be paired together.
The moment the pull/push CLI command is executed, the configuration id is returned in the response for those commands, for easier integration.
A stream can also be terminated by removing the corresponding config id: "removeConfig id=1234". This is actually the recommended way of removing pull/push configurations. It also works for HLS and HDS.
As for why is EMS only connects 4 times and not the 5th time as well, that is a different issue. I do not see anything wrong with the logs. We have to find a different way to see the problem in your environment. For this, if you can, please send me or Bryan a PM containing the credentials.