Skip to content

Commit

Permalink
Don't close SttpBackend in FlinkRestManager
Browse files Browse the repository at this point in the history
It's lifecycle extends beyond DeploymentManager
  • Loading branch information
piotrp committed Aug 31, 2023
1 parent c09f8d4 commit 99c0b71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
}

}

Expand Down

0 comments on commit 99c0b71

Please sign in to comment.