mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: fix ForkJoinPool not being autoclosable now
parent
76ecaf44ff
commit
51cf1bcbc6
|
|
@ -165,7 +165,8 @@ public class SingleStreamRecordingService extends RecordingService {
|
||||||
});
|
});
|
||||||
final CountDownLatch stoppedCountDown = new CountDownLatch(wrappers.size());
|
final CountDownLatch stoppedCountDown = new CountDownLatch(wrappers.size());
|
||||||
|
|
||||||
try (ForkJoinPool customThreadPool = new ForkJoinPool(4)) {
|
ForkJoinPool customThreadPool = new ForkJoinPool(4);
|
||||||
|
try {
|
||||||
customThreadPool.submit(() -> wrappers.parallelStream().forEach(wrapper -> {
|
customThreadPool.submit(() -> wrappers.parallelStream().forEach(wrapper -> {
|
||||||
this.stopRecorderEndpointOfPublisherEndpoint(recording.getId(), wrapper.getStreamId(), stoppedCountDown,
|
this.stopRecorderEndpointOfPublisherEndpoint(recording.getId(), wrapper.getStreamId(), stoppedCountDown,
|
||||||
kmsDisconnectionTime);
|
kmsDisconnectionTime);
|
||||||
|
|
@ -173,8 +174,11 @@ public class SingleStreamRecordingService extends RecordingService {
|
||||||
customThreadPool.shutdown();
|
customThreadPool.shutdown();
|
||||||
customThreadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
|
customThreadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
recording.setStatus(io.openvidu.java.client.Recording.Status.failed);
|
recording.setStatus(io.openvidu.java.client.Recording.Status.failed);
|
||||||
log.error("Exception while stopping recorder endpoints", e);
|
log.error("Exception while stopping recorder endpoints", e);
|
||||||
|
} finally {
|
||||||
|
customThreadPool.shutdownNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue