Skip to content

[EXPERIMENT] test with pekko 2.0.0-Mx#13741

Draft
pjfanning wants to merge 13 commits into
playframework:mainfrom
pjfanning:pekko-2.0
Draft

[EXPERIMENT] test with pekko 2.0.0-Mx#13741
pjfanning wants to merge 13 commits into
playframework:mainfrom
pjfanning:pekko-2.0

Conversation

@pjfanning

@pjfanning pjfanning commented Jan 15, 2026

Copy link
Copy Markdown
Contributor
  • pekko-http 2.0.0-M2 is released
  • it could be a number of months before 2.0.0 is released and it is not worth delaying Play releases for
  • this is just an experiment to see what Play code needs to change

@pjfanning

Copy link
Copy Markdown
Contributor Author

@mkurz I raised #13744 which is a non-trivial change needed to the websocket code and there are a couple of other changes needed to

@mkurz

mkurz commented Apr 22, 2026

Copy link
Copy Markdown
Member

@pjfanning failure in docs

[error] -- [E008] Not Found Error: /home/runner/work/playframework/playframework/documentation/manual/working/commonGuide/configuration/code/CustomPekkoHttpServer.scala:33:20 
[error] 33 |    defaultSettings.withWebsocketRandomFactory(() => new Random())
[error]    |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |value withWebsocketRandomFactory is not a member of org.apache.pekko.http.scaladsl.settings.ServerSettings, but could be made available as an extension method.
[error]    |
[error]    |The following import might make progress towards fixing the problem:
[error]    |
[error]    |  import org.apache.pekko.http.impl.util.JavaMapping.Implicits.convertToScala
[error]    |

@mkurz

mkurz commented Apr 22, 2026

Copy link
Copy Markdown
Member

Two more:

[error] -- [E008] Not Found Error: /home/runner/work/playframework/playframework/transport/server/play-pekko-http-server/src/test/scala/play/core/server/pekkohttp/PekkoHeadersWrapperTest.scala:17:40 
[error] 17 |      val request        = emptyRequest.copy()
[error]    |                           ^^^^^^^^^^^^^^^^^
[error]    |value copy is not a member of org.apache.pekko.http.scaladsl.model.HttpRequest, but could be made available as an extension method.
[error]    |
[error]    |One of the following imports might fix the problem:
[error]    |
[error]    |  import org.specs2.control.Properties.aProperty
[error]    |  import org.specs2.specification.Tables.toDataRow
[error]    |  import org.specs2.matcher.DataTables.toDataRow
[error]    |
[error] one error found
[error] /home/runner/work/playframework/playframework/core/play-integration-test/src/test/java/play/it/http/websocket/WebSocketSpecJavaActions.java:34:18: cannot find symbol
[error]   symbol:   method fromFuture(scala.concurrent.Future<java.lang.Object>)
[error]   location: class org.apache.pekko.stream.javadsl.Source
[error] Source.fromFuture
[error]                  ^

@mkurz

mkurz commented Apr 22, 2026

Copy link
Copy Markdown
Member

@pjfanning if you could take a look, would be nice, thank you πŸ™

@pjfanning

pjfanning commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

I'm away from my desk for most of today but can have a look in a few days. I'm expecting that there will be more issues than this remaining. The Java DSL in Pekko now tends to only support CompletionStages. There were a few methods added to newer versions of Pekko 1.x to fill in some gaps where some some Java DSL methods only accepted Scala Futures.

@pjfanning

Copy link
Copy Markdown
Contributor Author

This one is left

[error] /home/runner/work/playframework/playframework/documentation/manual/working/javaGuide/main/async/code/javaguide/async/JavaStream.java:233:60: cannot find symbol
[error]   symbol:   method dropNew()
[error]   location: class org.apache.pekko.stream.OverflowStrategy
[error] OverflowStrategy.dropNew

@pjfanning

Copy link
Copy Markdown
Contributor Author

Doc build still fails because an upgraded Agrona dependency uses sun.misc.Unsafe.

[error] Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: class org.agrona.UnsafeApi (in unnamed module @0xa88ffd8) cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @0xa88ffd8 [in thread "specs2-4"]
[error]     at org.agrona.UnsafeApi.getUnsafe(UnsafeApi.java)
[error]     at org.agrona.UnsafeApi.<clinit>(UnsafeApi.java)

In Pekko build, we add "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED" to workaround this.

@He-Pin

He-Pin commented May 25, 2026

Copy link
Copy Markdown
Contributor

This can be updated to 2.0.0-M2 now

@He-Pin

He-Pin commented May 25, 2026

Copy link
Copy Markdown
Contributor

Is there any performance difference with wrk?

@pjfanning pjfanning changed the title [EXPERIMENT] test with pekko 2.0.0-M1 [EXPERIMENT] test with pekko 2.0.0-M2 May 25, 2026
@pjfanning

Copy link
Copy Markdown
Contributor Author

code compiles but the build now needs to set an --add-opens for the Agrona lib to use sun.misc.Unsafe.

[error] Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: class org.agrona.UnsafeApi (in unnamed module @0x14ff0af5) cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @0x14ff0af5 [in thread "specs2-3"]
[error]     at org.agrona.UnsafeApi.getUnsafe(UnsafeApi.java)
[error]     at org.agrona.UnsafeApi.<clinit>(UnsafeApi.java)
[error]     at org.agrona.concurrent.AbstractConcurrentArrayQueue.<clinit>(AbstractConcurrentArrayQueue.java:126)
[error]     at org.apache.pekko.remote.artery.EnvelopeBufferPool.<init>(EnvelopeBufferPool.scala:37)
[error]     at org.apache.pekko.remote.artery.ArteryTransport.<init>(ArteryTransport.scala:354)
[error]     at org.apache.pekko.remote.artery.tcp.ArteryTcpTransport.<init>(ArteryTcpTransport.scala:82)
[error]     at org.apache.pekko.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:259)
[error]     at org.apache.pekko.cluster.ClusterActorRefProvider.init(ClusterActorRefProvider.scala:60)
[error]     at org.apache.pekko.actor.ActorSystemImpl._start$lzyINIT1(ActorSystem.scala:1085)
[error]     at org.apache.pekko.actor.ActorSystemImpl._start(ActorSystem.scala:1081)
[error]     at org.apache.pekko.actor.ActorSystemImpl.start(ActorSystem.scala:1104)
[error]     at org.apache.pekko.actor.ActorSystem$.apply(ActorSystem.scala:284)
[error]     at play.api.libs.concurrent.ActorSystemProvider$.start(Pekko.scala:243)

@He-Pin

He-Pin commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Should be M3 now.

@He-Pin

He-Pin commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Maybe we can replace Agrona with jctools

@pjfanning pjfanning changed the title [EXPERIMENT] test with pekko 2.0.0-M2 [EXPERIMENT] test with pekko 2.0.0-Mx Jun 17, 2026
@pjfanning

pjfanning commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

I'm inclined to close this at this stage. It shows the code compiles but the tests run into at least 2 issues.

  • any tests that use pekko-remote need to have javaOptions that include --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
  • the sbt-plugin scripted tests run into issues with sbt evictionLevelWarnings. could set ThisBuild / evictionLevelWarnings := Level.Info while playing with milestone builds and remove them later but there are a lot of sbt files affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants