Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeouts from bloop-rifle and watch mode issues since 1.5.x. #3343

Closed
keynmol opened this issue Dec 3, 2024 · 3 comments · Fixed by #3351
Closed

Timeouts from bloop-rifle and watch mode issues since 1.5.x. #3343

keynmol opened this issue Dec 3, 2024 · 3 comments · Fixed by #3351
Assignees
Labels
--watch Issues tied to watching sources Bloop Issues tied with Bloop integration. bug Something isn't working

Comments

@keynmol
Copy link
Contributor

keynmol commented Dec 3, 2024

Version(s)
1.5.4

Describe the bug
Very frequent timeouts from bloop-rifle, and watch mode occasionally refusing to pick up changes - only restarting helps, but then it crashes again

image

https://discord.com/channels/632150470000902164/901153021638082660/1312768811602284617

To Reproduce

I get it constantly when working on https://github.com/keynmol/cue4s-xterm-demo but I've seen it in all projects that I have that use --watch mode.

Just run scala-cli --power package . -w -f -o scalajs-frontend.js --js-module-kind es and edit files for a bit - eventually it will crash.

Expected behaviour

Doesn't crash or times out

@keynmol keynmol added the bug Something isn't working label Dec 3, 2024
@Gedochao Gedochao added --watch Issues tied to watching sources Bloop Issues tied with Bloop integration. labels Dec 3, 2024
@Gedochao
Copy link
Contributor

Gedochao commented Dec 3, 2024

Yeah... I can reproduce it alright.
Not sure what's going on here just yet, but thanks for raising the issue.
I suspect that whatever is happening is something introduced by #3218.

@Gedochao
Copy link
Contributor

Gedochao commented Dec 4, 2024

So... to reproduce it, it's enough to just run:

@main def main(): Unit = println("Hello")

with

scala-cli run . --watch

and then modify the file 5 times.

Here's the stacktrace:

java.lang.Exception: Timeout while waiting for buildInitialize response
  bloop.rifle.BloopServer$.buildServer(BloopServer.scala:223)
  scala.build.compiler.BloopCompilerMaker.$anonfun$1(BloopCompilerMaker.scala:48)
  scala.build.compiler.BloopCompiler.<init>(BloopCompiler.scala:15)
  scala.build.compiler.BloopCompilerMaker.$anonfun$2(BloopCompilerMaker.scala:51)
  scala.util.Try$.apply(Try.scala:217)
  scala.build.compiler.BloopCompilerMaker.create(BloopCompilerMaker.scala:51)
  scala.build.Build$.info$1$$anonfun$1(Build.scala:697)
  scala.build.EitherCps$Helper.apply(EitherCps.scala:19)
  scala.build.Build$.info$1(Build.scala:687)
  scala.build.Build$.run$1(Build.scala:715)
  scala.build.Build$.$anonfun$24(Build.scala:748)
  scala.build.Build$.$anonfun$adapted$1(Build.scala:748)
  scala.Function0.apply$mcV$sp(Function0.scala:42)
  scala.build.Build$Watcher.$init$$$anonfun$1(Build.scala:1274)
  java.base@17.0.6/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
  java.base@17.0.6/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  java.base@17.0.6/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
  java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  java.base@17.0.6/java.lang.Thread.run(Thread.java:833)
  com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
java.util.concurrent.TimeoutException
  java.base@17.0.6/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1960)
  java.base@17.0.6/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095)
  bloop.rifle.BloopServer$.buildServer(BloopServer.scala:220)
  scala.build.compiler.BloopCompilerMaker.$anonfun$1(BloopCompilerMaker.scala:48)
  scala.build.compiler.BloopCompiler.<init>(BloopCompiler.scala:15)
  scala.build.compiler.BloopCompilerMaker.$anonfun$2(BloopCompilerMaker.scala:51)
  scala.util.Try$.apply(Try.scala:217)
  scala.build.compiler.BloopCompilerMaker.create(BloopCompilerMaker.scala:51)
  scala.build.Build$.info$1$$anonfun$1(Build.scala:697)
  scala.build.EitherCps$Helper.apply(EitherCps.scala:19)
  scala.build.Build$.info$1(Build.scala:687)
  scala.build.Build$.run$1(Build.scala:715)
  scala.build.Build$.$anonfun$24(Build.scala:748)
  scala.build.Build$.$anonfun$adapted$1(Build.scala:748)
  scala.Function0.apply$mcV$sp(Function0.scala:42)
  scala.build.Build$Watcher.$init$$$anonfun$1(Build.scala:1274)
  java.base@17.0.6/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
  java.base@17.0.6/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  java.base@17.0.6/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
  java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  java.base@17.0.6/java.lang.Thread.run(Thread.java:833)
  com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)

cc @tgodzik

@tgodzik
Copy link
Member

tgodzik commented Dec 4, 2024

For sure we should not need to reconnect every time and looks like Bloop is no handling that very well. I am not sure however why is that happening, but we can add similar tests in the bloop repo to se if it reproduces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--watch Issues tied to watching sources Bloop Issues tied with Bloop integration. bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants