mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: KmsManager.MAX_SECONDS_LOCK_WAIT
parent
c9a5709852
commit
72c62772f2
|
@ -82,8 +82,6 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
@Autowired
|
@Autowired
|
||||||
private KurentoParticipantEndpointConfig kurentoEndpointConfig;
|
private KurentoParticipantEndpointConfig kurentoEndpointConfig;
|
||||||
|
|
||||||
private final int MS_MAX_LOCK_WAIT = 15;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
/* Protected by Session.closingLock.readLock */
|
/* Protected by Session.closingLock.readLock */
|
||||||
public void joinRoom(Participant participant, String sessionId, Integer transactionId) {
|
public void joinRoom(Participant participant, String sessionId, Integer transactionId) {
|
||||||
|
@ -105,7 +103,7 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (KmsManager.selectAndRemoveKmsLock.tryLock(MS_MAX_LOCK_WAIT, TimeUnit.SECONDS)) {
|
if (KmsManager.selectAndRemoveKmsLock.tryLock(KmsManager.MAX_SECONDS_LOCK_WAIT, TimeUnit.SECONDS)) {
|
||||||
try {
|
try {
|
||||||
kSession = (KurentoSession) sessions.get(sessionId);
|
kSession = (KurentoSession) sessions.get(sessionId);
|
||||||
|
|
||||||
|
@ -131,7 +129,7 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
String error = "Timeout of " + MS_MAX_LOCK_WAIT + " seconds waiting to acquire lock";
|
String error = "Timeout of " + KmsManager.MAX_SECONDS_LOCK_WAIT + " seconds waiting to acquire lock";
|
||||||
log.error(error);
|
log.error(error);
|
||||||
sessionEventsHandler.onParticipantJoined(participant, sessionId, null, transactionId,
|
sessionEventsHandler.onParticipantJoined(participant, sessionId, null, transactionId,
|
||||||
new OpenViduException(Code.ROOM_CANNOT_BE_CREATED_ERROR_CODE, error));
|
new OpenViduException(Code.ROOM_CANNOT_BE_CREATED_ERROR_CODE, error));
|
||||||
|
|
|
@ -49,6 +49,7 @@ public abstract class KmsManager {
|
||||||
protected static final Logger log = LoggerFactory.getLogger(KmsManager.class);
|
protected static final Logger log = LoggerFactory.getLogger(KmsManager.class);
|
||||||
|
|
||||||
public static final Lock selectAndRemoveKmsLock = new ReentrantLock(true);
|
public static final Lock selectAndRemoveKmsLock = new ReentrantLock(true);
|
||||||
|
public static final int MAX_SECONDS_LOCK_WAIT = 15;
|
||||||
|
|
||||||
private Map<String, Lock> kmsReconnectionLocks = new ConcurrentHashMap<>();
|
private Map<String, Lock> kmsReconnectionLocks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue