Skip to content

Commit 3bbdca2

Browse files
committed
Fix regression on threadpool termination
After the Scala 3 change, cluster.disconnect() stops the threadpool but no longer blocks on that termination. Change-Id: I8e823f2e1e51f92db4b727a324785be4a72a6ebd Reviewed-on: https://review.couchbase.org/c/couchbase-jvm-clients/+/230811 Reviewed-by: Graham Pople <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent c53e0d2 commit 3bbdca2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scala-client/src/main/scala/com/couchbase/client/scala/env/ClusterEnvironment.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package com.couchbase.client.scala.env
1818

19-
import java.util.concurrent.{Executors, ThreadFactory}
19+
import java.util.concurrent.{Executors, ThreadFactory, TimeUnit}
2020
import com.couchbase.client.core
2121
import com.couchbase.client.core.annotation.SinceCouchbase
2222
import com.couchbase.client.core.annotation.Stability.{Uncommitted, Volatile}
@@ -401,6 +401,7 @@ class ClusterEnvironment(private[scala] val builder: ClusterEnvironment.Builder)
401401
if (!threadPool.isShutdown) {
402402
coreEnv.shutdown(timeout)
403403
threadPool.shutdownNow()
404+
threadPool.awaitTermination(timeout.toMillis, TimeUnit.MILLISECONDS)
404405
defaultScheduler.dispose()
405406
}
406407
}

0 commit comments

Comments
 (0)