Skip to content

Commit

Permalink
Ata 6069 connector leak upgrades (#624)
Browse files Browse the repository at this point in the history
* upated the depoendendencies for doobie and fs2 to fix the connection leak

Signed-off-by: Shailesh <shailesh.patil@iohk.io>

* ran scalafmt

Signed-off-by: Shailesh <shailesh.patil@iohk.io>

* code cleanup

Signed-off-by: Shailesh <shailesh.patil@iohk.io>
  • Loading branch information
mineme0110 authored Feb 1, 2022
1 parent 635c44f commit db68410
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,6 @@ class ConnectorService(
recipientId = recipientId,
lastSeenMessageId = lastSeenMessageId
)
.onFinalize {
// This is crucial to prevent the db stream opened indefinitely - producting a connection leak per client
// TODO: This should likely go in MessagesRepositoryImpl but I'm not sure about the implications, hence,
// let's leave this here until we understand the issue better.
TraceId.liftToIOWithTraceId(cats.effect.IO.unit)
}

val newMessageStream = messageNotificationService
.stream(recipientId)
Expand Down
6 changes: 5 additions & 1 deletion prism-backend/project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sbt.Keys.libraryDependencySchemes
import sbt._

object versions {
Expand All @@ -9,7 +10,7 @@ object versions {
val diffx = "0.7.0"
val dockerClient = "8.16.0"
val dockerTestkit = "0.9.9"
val doobie = "1.0.0-RC1"
val doobie = "1.0.0-RC2"
val enumeratum = "1.7.0"
val enumeratumDoobie = "1.7.0"
val flyway = "8.4.2"
Expand All @@ -31,6 +32,7 @@ object versions {
val twirl = "1.5.1"
val typesafeConfig = "1.4.1"
val http4s = "0.21.7"
val fs2 = "3.2.4"
val prismSdk = "1.3.0-build-4-0ad8c1c7"
val vaultSdk = "0.1.0-build-2-96cc137d"
}
Expand Down Expand Up @@ -87,6 +89,7 @@ object Dependencies {
"org.http4s" %% "http4s-blaze-server" % versions.http4s
val http4sBlazeClient =
"org.http4s" %% "http4s-blaze-client" % versions.http4s
val fs2 = "co.fs2" %% "fs2-io" % versions.fs2

// SDK dependencies

Expand Down Expand Up @@ -154,6 +157,7 @@ object Dependencies {
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion
)
val overrideVersionSchemes = libraryDependencySchemes += "org.tpolecat" %% "doobie-core" % VersionScheme.Always

// cardano-address library binary
val cardanoAddressBinaryUrl =
Expand Down
19 changes: 13 additions & 6 deletions prism-backend/project/PrismBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Dependencies._
import com.typesafe.sbt.GitVersioning
import com.typesafe.sbt.GitPlugin.autoImport._
import play.twirl.sbt.SbtTwirl
import sbt.Keys._
import sbt.Keys.{libraryDependencySchemes, _}
import sbt._
import sbtassembly.AssemblyPlugin.autoImport._
import sbtbuildinfo.BuildInfoPlugin
Expand Down Expand Up @@ -114,10 +114,12 @@ object PrismBuild {
Seq(
diffx,
flyway,
typesafeConfig
typesafeConfig,
fs2
) ++
prismDependencies ++
scalapbDependencies,
overrideVersionSchemes,
Compile / PB.targets := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "proto"
)
Expand Down Expand Up @@ -176,6 +178,7 @@ object PrismBuild {
commonServerProject("node")
.settings(
name := "node",
overrideVersionSchemes,
Compile / run / mainClass := Some("io.iohk.atala.prism.node.NodeApp")
)
.dependsOn(common % "compile->compile;test->test")
Expand All @@ -188,7 +191,8 @@ object PrismBuild {
"io.iohk.atala.prism.connector.ConnectorApp"
),
scalacOptions ~= (_ :+ "-Wconf:src=.*twirl/.*:silent"),
libraryDependencies += twirlApi
libraryDependencies += twirlApi,
overrideVersionSchemes
)
.dependsOn(common % "compile->compile;test->test")
.enablePlugins(SbtTwirl)
Expand All @@ -200,15 +204,17 @@ object PrismBuild {
resolvers += Resolver.sonatypeRepo("snapshots"),
libraryDependencies ++= Seq(
enumeratum
)
),
overrideVersionSchemes
)
.dependsOn(common)

lazy val vault =
commonServerProject("vault")
.settings(
name := "vault",
Compile / run / mainClass := Some("io.iohk.atala.prism.vault.VaultApp")
Compile / run / mainClass := Some("io.iohk.atala.prism.vault.VaultApp"),
overrideVersionSchemes
)
.dependsOn(common % "compile->compile;test->test")

Expand All @@ -218,7 +224,8 @@ object PrismBuild {
name := "management-console",
Compile / run / mainClass := Some(
"io.iohk.atala.prism.management.console.ManagementConsoleApp"
)
),
overrideVersionSchemes
)
.dependsOn(common % "compile->compile;test->test")

Expand Down

0 comments on commit db68410

Please sign in to comment.