mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: change order of action upon KurentoClient disconnection (nodeCrashed)
parent
58c4d565f6
commit
8559ca96d4
|
@ -220,14 +220,14 @@ public abstract class KmsManager {
|
||||||
final List<String> affectedRecordingIds = kms.getActiveRecordings().stream()
|
final List<String> affectedRecordingIds = kms.getActiveRecordings().stream()
|
||||||
.map(entry -> entry.getKey()).collect(Collectors.toUnmodifiableList());
|
.map(entry -> entry.getKey()).collect(Collectors.toUnmodifiableList());
|
||||||
|
|
||||||
sessionEventsHandler.onMediaNodeCrashed(kms, timeOfKurentoDisconnection, affectedSessionIds,
|
// 1. Remove Media Node from cluster
|
||||||
affectedRecordingIds);
|
log.warn("Removing Media Node {} after crash", kms.getId());
|
||||||
|
removeMediaNodeUponCrash(kms.getId());
|
||||||
|
|
||||||
// Close all sessions and recordings with reason "nodeCrashed"
|
// 2. Close all sessions and recordings with reason "nodeCrashed"
|
||||||
log.warn("Closing {} sessions hosted by KMS with uri {}: {}", kms.getKurentoSessions().size(),
|
log.warn("Closing {} sessions hosted by KMS with uri {}: {}", kms.getKurentoSessions().size(),
|
||||||
kms.getUri(), kms.getKurentoSessions().stream().map(s -> s.getSessionId())
|
kms.getUri(), kms.getKurentoSessions().stream().map(s -> s.getSessionId())
|
||||||
.collect(Collectors.joining(",", "[", "]")));
|
.collect(Collectors.joining(",", "[", "]")));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Flag the thread to skip remote operations to KMS
|
// Flag the thread to skip remote operations to KMS
|
||||||
RemoteOperationUtils.setToSkipRemoteOperations();
|
RemoteOperationUtils.setToSkipRemoteOperations();
|
||||||
|
@ -236,9 +236,9 @@ public abstract class KmsManager {
|
||||||
RemoteOperationUtils.revertToRunRemoteOperations();
|
RemoteOperationUtils.revertToRunRemoteOperations();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove Media Node
|
// 3. Send nodeCrashed webhook event
|
||||||
log.warn("Removing Media Node {} after crash", kms.getId());
|
sessionEventsHandler.onMediaNodeCrashed(kms, timeOfKurentoDisconnection, affectedSessionIds,
|
||||||
removeMediaNodeUponCrash(kms.getId());
|
affectedRecordingIds);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue