This strange case reproduced for only one my client’s server. Server version is 3.6.4 build9641. I have following code
for(String vHostName: (List<String>)server.getVHostList().getVHostNames())
{
IVHost vhost = VHostSingleton.getInstance(vHostName);
if(vhost==null)continue;
for(String appName: (List<String>)vhost.getApplicationNames()){
IApplication application = vhost.getApplication((String) appName);
if(application == null) continue;
for(String appIntanceName : application.getAppInstanceNames()){
IApplicationInstance appIntance = application.getAppInstance(appIntanceName);
if(appIntance == null) continue;
for(IClient client: appIntance.getClients())
{
// Exception: java.util.ConcurrentModificationException|at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)|at java.util.ArrayList$Itr.next(ArrayList.java:831)|
for(IMediaStream stream : (List<IMediaStream>)client.getPlayStreams()){
}
}
}
}
}
so it looks like client.getPlayStreams() changed outside the look in different thread. All examples in wowza articles use the same approach and client.getPlayStreams() not locked or syncronized before iteration. why this happends and what should I do to prevent this case? or may be i need to handle it and retry ?