mirror of https://github.com/OpenVidu/openvidu.git
Avoid reconnection check when KurentoClient explicitly closed
parent
8c1703aa54
commit
5f3902d973
|
@ -203,9 +203,15 @@ public abstract class KmsManager {
|
||||||
public void disconnected() {
|
public void disconnected() {
|
||||||
final Kms kms = kmss.get(kmsId);
|
final Kms kms = kmss.get(kmsId);
|
||||||
|
|
||||||
log.info("Kurento Client \"disconnected\" event for KMS {} [{}]", kms.getUri(),
|
if(kms.getKurentoClient().isClosed()) {
|
||||||
kms.getKurentoClient().toString());
|
log.info("Kurento Client \"disconnected\" event for KMS {} [{}]. Closed explicitely", kms.getUri(),
|
||||||
|
kms.getKurentoClient().toString());
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
log.info("Kurento Client \"disconnected\" event for KMS {} [{}]. Waiting reconnection", kms.getUri(),
|
||||||
|
kms.getKurentoClient().toString());
|
||||||
|
}
|
||||||
|
|
||||||
kms.setKurentoClientConnected(false);
|
kms.setKurentoClientConnected(false);
|
||||||
kms.setTimeOfKurentoClientDisconnection(System.currentTimeMillis());
|
kms.setTimeOfKurentoClientDisconnection(System.currentTimeMillis());
|
||||||
|
|
||||||
|
@ -219,16 +225,26 @@ public abstract class KmsManager {
|
||||||
try {
|
try {
|
||||||
if (kmsReconnectionLocks.get(kms.getId()).tryLock(5, TimeUnit.SECONDS)) {
|
if (kmsReconnectionLocks.get(kms.getId()).tryLock(5, TimeUnit.SECONDS)) {
|
||||||
lockAcquired = true;
|
lockAcquired = true;
|
||||||
|
|
||||||
if (kms.isKurentoClientConnected()) {
|
if (kms.isKurentoClientConnected()) {
|
||||||
// reconnected listener already executed
|
// reconnected listener already executed
|
||||||
log.warn(
|
log.info(
|
||||||
"Timer of KMS with uri {} and KurentoClient [{}] cancelled (reconnected event received during interval wait)",
|
"Timer of KMS with uri {} and KurentoClient [{}] cancelled (reconnected event received during interval wait)",
|
||||||
kms.getUri(), kms.getKurentoClient().toString());
|
kms.getUri(), kms.getKurentoClient().toString());
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(kms.getKurentoClient().isClosed()) {
|
||||||
|
log.info(
|
||||||
|
"Timer of KMS with uri {} and KurentoClient [{}] has been closed. Cancelling Timer",
|
||||||
|
kms.getUri(), kms.getKurentoClient().toString());
|
||||||
|
timer.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
kms.getKurentoClient().getServerManager().getInfo();
|
kms.getKurentoClient().getServerManager().getInfo();
|
||||||
log.warn("According to Timer KMS with uri {} and KurentoClient [{}] is now reconnected",
|
log.info("According to Timer KMS with uri {} and KurentoClient [{}] is now reconnected",
|
||||||
kms.getUri(), kms.getKurentoClient().toString());
|
kms.getUri(), kms.getKurentoClient().toString());
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
kms.setKurentoClientConnected(true);
|
kms.setKurentoClientConnected(true);
|
||||||
|
|
Loading…
Reference in New Issue