openvidu-server: some WARN level logging to INFO level

pull/370/head
pabloFuente 2019-12-03 15:36:31 +01:00
parent af31713c66
commit c6adaa2688
4 changed files with 16 additions and 16 deletions

View File

@ -331,7 +331,9 @@ public class KurentoParticipant extends Participant {
this.getParticipantPublicId(), remoteParticipantName); this.getParticipantPublicId(), remoteParticipantName);
} }
} }
releasePublisherEndpoint(reason, kmsDisconnectionTime); if (publisher != null && publisher.getEndpoint() != null) {
releasePublisherEndpoint(reason, kmsDisconnectionTime);
}
} }
/** /**

View File

@ -515,7 +515,8 @@ public class KurentoSessionManager extends SessionManager {
// Also associate the KurentoSession with the Kms // Also associate the KurentoSession with the Kms
kms.addKurentoSession(session); kms.addKurentoSession(session);
log.warn("No session '{}' exists yet. Created one on KMS '{}'", session.getSessionId(), kms.getUri()); log.info("No session '{}' exists yet. Created one on KMS '{}' with ip '{}'", session.getSessionId(),
kms.getId(), kms.getIp());
sessionEventsHandler.onSessionCreated(session); sessionEventsHandler.onSessionCreated(session);
return session; return session;
@ -847,7 +848,8 @@ public class KurentoSessionManager extends SessionManager {
} }
@Override @Override
public Participant publishIpcam(Session session, MediaOptions mediaOptions, String serverMetadata) throws Exception { public Participant publishIpcam(Session session, MediaOptions mediaOptions, String serverMetadata)
throws Exception {
final String sessionId = session.getSessionId(); final String sessionId = session.getSessionId();
final KurentoMediaOptions kMediaOptions = (KurentoMediaOptions) mediaOptions; final KurentoMediaOptions kMediaOptions = (KurentoMediaOptions) mediaOptions;

View File

@ -98,22 +98,20 @@ public abstract class KmsManager {
return this.kmss.remove(kmsId); return this.kmss.remove(kmsId);
} }
public synchronized Kms getLessLoadedKms() throws NoSuchElementException {
return Collections.min(getKmsLoads()).kms;
}
public synchronized Kms getLessLoadedAndRunningKms() throws NoSuchElementException { public synchronized Kms getLessLoadedAndRunningKms() throws NoSuchElementException {
List<KmsLoad> kmsLoads = getKmsLoads().stream() List<KmsLoad> kmsLoads = getKmsLoads().stream()
.filter(kmsLoad -> mediaNodeStatusManager.isRunning(kmsLoad.kms.getId())).collect(Collectors.toList()); .filter(kmsLoad -> mediaNodeStatusManager.isRunning(kmsLoad.kms.getId())).collect(Collectors.toList());
return Collections.min(kmsLoads).kms; return Collections.min(kmsLoads).kms;
} }
public Kms getKms(String kmsId) { public synchronized List<KmsLoad> getKmssSortedByLoad() {
return this.kmss.get(kmsId); List<KmsLoad> kmsLoads = getKmsLoads();
Collections.sort(kmsLoads);
return kmsLoads;
} }
public boolean kmsWithUriExists(String kmsUri) { public Kms getKms(String kmsId) {
return this.kmss.values().stream().anyMatch(kms -> kms.getUri().equals(kmsUri)); return this.kmss.get(kmsId);
} }
public KmsLoad getKmsLoad(String kmsId) { public KmsLoad getKmsLoad(String kmsId) {
@ -125,10 +123,8 @@ public abstract class KmsManager {
return this.kmss.values(); return this.kmss.values();
} }
public synchronized List<KmsLoad> getKmssSortedByLoad() { public boolean kmsWithUriExists(String kmsUri) {
List<KmsLoad> kmsLoads = getKmsLoads(); return this.kmss.values().stream().anyMatch(kms -> kms.getUri().equals(kmsUri));
Collections.sort(kmsLoads);
return kmsLoads;
} }
private List<KmsLoad> getKmsLoads() { private List<KmsLoad> getKmsLoads() {

View File

@ -603,7 +603,7 @@ public class RecordingManager {
log.warn("No KMSs were defined in kms.uris array. Recording path check aborted"); log.warn("No KMSs were defined in kms.uris array. Recording path check aborted");
} else { } else {
MediaPipeline pipeline = this.kmsManager.getLessLoadedKms().getKurentoClient().createMediaPipeline(); MediaPipeline pipeline = this.kmsManager.getLessLoadedAndRunningKms().getKurentoClient().createMediaPipeline();
RecorderEndpoint recorder = new RecorderEndpoint.Builder(pipeline, "file://" + testFilePath).build(); RecorderEndpoint recorder = new RecorderEndpoint.Builder(pipeline, "file://" + testFilePath).build();
final AtomicBoolean kurentoRecorderError = new AtomicBoolean(false); final AtomicBoolean kurentoRecorderError = new AtomicBoolean(false);