Skip to content

Commit

Permalink
Akka-related startup improvements (#10905)
Browse files Browse the repository at this point in the history
* Akka-related startup improvements

Realized that Akka Typed and Spray were not used **at all** yet there
were in the list of dependencies.
Additionally, the former would also show up in the list of Akka's
library-extensions, initialized on startup.

* Hardcode list of library extensions

Hardcoding a list of library extensions is not recommended but I don't
see any other way of disabling expensive Serialization extension, which
we don't seem to use anyway.

* fmt

* licensing update
  • Loading branch information
hubertp authored Aug 29, 2024
1 parent 018b676 commit 1e6e69b
Show file tree
Hide file tree
Showing 31 changed files with 19 additions and 265 deletions.
19 changes: 7 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -407,22 +407,17 @@ val logbackPkg = Seq(
"ch.qos.logback" % "logback-classic" % logbackClassicVersion,
"ch.qos.logback" % "logback-core" % logbackClassicVersion
)
val akkaActor = akkaPkg("actor")
val akkaStream = akkaPkg("stream")
val akkaTyped = akkaPkg("actor-typed")
val akkaTestkit = akkaPkg("testkit")
val akkaSLF4J = akkaPkg("slf4j")
val akkaTestkitTyped = akkaPkg("actor-testkit-typed") % Test
val akkaHttp = akkaHTTPPkg("http")
val akkaSpray = akkaHTTPPkg("http-spray-json")
val logbackTest = logbackPkg.map(_ % Test)
val akkaActor = akkaPkg("actor")
val akkaStream = akkaPkg("stream")
val akkaTestkit = akkaPkg("testkit")
val akkaSLF4J = akkaPkg("slf4j")
val akkaHttp = akkaHTTPPkg("http")
val logbackTest = logbackPkg.map(_ % Test)
val akka =
Seq(
akkaActor,
akkaStream,
akkaHttp,
akkaSpray,
akkaTyped
akkaHttp
)

// === Cats ===================================================================
Expand Down
20 changes: 0 additions & 20 deletions distribution/engine/THIRD-PARTY/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.monovore.decline_2.13-2.4.1`.


'akka-actor-typed_2.13', licensed under the Apache-2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-actor-typed_2.13-2.6.20`.


'akka-actor_2.13', licensed under the Apache-2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-actor_2.13-2.6.20`.
Expand All @@ -91,11 +86,6 @@ The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-http-core_2.13-10.2.10`.


'akka-http-spray-json_2.13', licensed under the Apache-2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-http-spray-json_2.13-10.2.10`.


'akka-http_2.13', licensed under the Apache-2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-http_2.13-10.2.10`.
Expand All @@ -111,11 +101,6 @@ The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-protobuf-v3_2.13-2.6.20`.


'akka-slf4j_2.13', licensed under the Apache-2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-slf4j_2.13-2.6.20`.


'akka-stream_2.13', licensed under the Apache-2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-stream_2.13-2.6.20`.
Expand Down Expand Up @@ -386,11 +371,6 @@ The license file can be found at `licenses/MIT`.
Copyright notices related to this dependency can be found in the directory `io.sentry.sentry-logback-6.28.0`.


'spray-json_2.13', licensed under the Apache 2, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `io.spray.spray-json_2.13-1.3.6`.


'jakarta.inject-api', licensed under the The Apache Software License, Version 2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `jakarta.inject.jakarta.inject-api-2.0.1`.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions distribution/project-manager/THIRD-PARTY/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.flatbuffers.flatbuffers-java-24.3.25`.


'akka-actor-typed_2.13', licensed under the Apache-2.0, is distributed with the project-manager.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-actor-typed_2.13-2.6.20`.


'akka-actor_2.13', licensed under the Apache-2.0, is distributed with the project-manager.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-actor_2.13-2.6.20`.
Expand All @@ -71,11 +66,6 @@ The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-http-core_2.13-10.2.10`.


'akka-http-spray-json_2.13', licensed under the Apache-2.0, is distributed with the project-manager.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-http-spray-json_2.13-10.2.10`.


'akka-http_2.13', licensed under the Apache-2.0, is distributed with the project-manager.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-http_2.13-10.2.10`.
Expand All @@ -91,11 +81,6 @@ The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-protobuf-v3_2.13-2.6.20`.


'akka-slf4j_2.13', licensed under the Apache-2.0, is distributed with the project-manager.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-slf4j_2.13-2.6.20`.


'akka-stream_2.13', licensed under the Apache-2.0, is distributed with the project-manager.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-stream_2.13-2.6.20`.
Expand Down Expand Up @@ -346,11 +331,6 @@ The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `io.helidon.websocket.helidon-websocket-4.0.8`.


'spray-json_2.13', licensed under the Apache 2, is distributed with the project-manager.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `io.spray.spray-json_2.13-1.3.6`.


'jakarta.inject-api', licensed under the The Apache Software License, Version 2.0, is distributed with the project-manager.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `jakarta.inject.jakarta.inject-api-2.0.1`.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions engine/language-server/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ akka {
}
log-dead-letters = 1
log-dead-letters-during-shutdown = off
library-extensions = ["akka.stream.SystemMaterializer$"]
}

logging-service {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.enso.languageserver.boot

import akka.actor.ActorSystem
import akka.stream.Materializer
import buildinfo.Info
import com.typesafe.config.ConfigFactory
import org.enso.distribution.locking.{
Expand Down Expand Up @@ -62,7 +63,6 @@ import java.io.{File, PrintStream}
import java.net.URI
import java.nio.charset.StandardCharsets
import java.time.Clock

import scala.concurrent.duration.DurationInt

/** A main module containing all components of the server.
Expand Down Expand Up @@ -110,7 +110,7 @@ class MainModule(serverConfig: LanguageServerConfig, logLevel: Level) {
)
log.trace("Created Language Server config [{}]", languageServerConfig)

implicit val system: ActorSystem =
val system: ActorSystem =
ActorSystem(
serverConfig.name,
None,
Expand Down Expand Up @@ -453,7 +453,7 @@ class MainModule(serverConfig: LanguageServerConfig, logLevel: Level) {
profilingManager = profilingManager,
libraryConfig = libraryConfig,
config = languageServerConfig
)
)(system)
log.trace(
"Created JSON connection controller factory [{}]",
jsonRpcControllerFactory
Expand All @@ -466,6 +466,7 @@ class MainModule(serverConfig: LanguageServerConfig, logLevel: Level) {
Some(_)
)

val materializer: Materializer = Materializer.createMaterializer(system)
val jsonRpcServer =
new JsonRpcServer(
jsonRpcProtocolFactory,
Expand All @@ -478,21 +479,21 @@ class MainModule(serverConfig: LanguageServerConfig, logLevel: Level) {
),
List(healthCheckEndpoint, idlenessEndpoint),
messagesCallback
)
)(system, materializer)
log.trace("Created JSON RPC Server [{}]", jsonRpcServer)

val binaryServer =
new BinaryWebSocketServer(
InboundMessageDecoder,
BinaryEncoder.empty,
new BinaryConnectionControllerFactory(fileManager),
new BinaryConnectionControllerFactory(fileManager)(system),
BinaryWebSocketServer.Config(
outgoingBufferSize = 100,
lazyMessageTimeout = 10.seconds,
secureConfig = secureConfig
),
messagesCallback
)
)(system, materializer)
log.trace("Created Binary WebSocket Server [{}]", binaryServer)

log.debug(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ abstract class Server(implicit private val system: ActorSystem) {
.generateSSLContext()
.map(ctx => ConnectionContext.httpsServer(ctx))
.toOption

})
httpsContext match {
case Some(ctx) =>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1e6e69b

Please sign in to comment.