From 99c0b713eb34b7ba32aaf4d5132f2d7f8dba225a Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Thu, 31 Aug 2023 14:56:56 +0200 Subject: [PATCH] Don't close SttpBackend in FlinkRestManager It's lifecycle extends beyond DeploymentManager --- docs/Changelog.md | 3 +++ .../nussknacker/engine/management/FlinkRestManager.scala | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 4a297a7955c..a261c688476 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -7,6 +7,9 @@ * [#4561](https://github.com/TouK/nussknacker/pull/4561) Improvement: Users are not required at OAuth2 config file * [#4492](https://github.com/TouK/nussknacker/pull/4492) Allow testing fragments using ad hoc testing. +1.11.2 (Not released yet) +* [#4629](https://github.com/TouK/nussknacker/pull/4629) Fix closing of shared SttpBackend when reloading model + 1.11.1 (25 Aug 2023) ------------------------- * [#4603](https://github.com/TouK/nussknacker/pull/4603) Fix subprocess -> fragment migration diff --git a/engine/flink/management/src/main/scala/pl/touk/nussknacker/engine/management/FlinkRestManager.scala b/engine/flink/management/src/main/scala/pl/touk/nussknacker/engine/management/FlinkRestManager.scala index f7b551d3392..a5573a53315 100644 --- a/engine/flink/management/src/main/scala/pl/touk/nussknacker/engine/management/FlinkRestManager.scala +++ b/engine/flink/management/src/main/scala/pl/touk/nussknacker/engine/management/FlinkRestManager.scala @@ -17,9 +17,7 @@ import pl.touk.nussknacker.engine.management.rest.flinkRestModel.JobOverview import sttp.client3._ import java.io.File -import java.util.concurrent.TimeUnit -import scala.concurrent.duration.Duration -import scala.concurrent.{Await, ExecutionContext, Future} +import scala.concurrent.{ExecutionContext, Future} class FlinkRestManager(config: FlinkConfig, modelData: BaseModelData, mainClassName: String) (implicit ec: ExecutionContext, backend: SttpBackend[Future, Any], deploymentService: ProcessingTypeDeploymentService) @@ -159,7 +157,9 @@ class FlinkRestManager(config: FlinkConfig, modelData: BaseModelData, mainClassN Future.successful(()) } - override def close(): Unit = Await.result(backend.close(), Duration(10, TimeUnit.SECONDS)) + override def close(): Unit = { + logger.info("Closing Flink REST manager") + } }