question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

run and runAll directly stops after services where started

See original GitHub issue

Lagom Version (1.2.x / 1.3.x / etc)

1.4.0

API (Scala / Java / Neither / Both)

Scala

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

macOS Darwin deess1nb1337.de.root.net 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64

JDK (Oracle 1.8.0_112, OpenJDK 1.8.x, Azul Zing)

Oracle java version “1.8.0_141”

The issue

Unfortunately it’s hard to reproduce but maybe others have the same issue. After starting/stopping Lagom a few times I can not start it anymore because it directly stops. This happens for runAll but also if I directly start infra services and start a single service with run. The output looks similar to this:

09:56:33.730 | ForkJoinPoo | INFO  | play.api.Play - Application started (Dev)
[info] Service a1-impl listening for HTTP on 0:0:0:0:0:0:0:0:62636
[info] Service a2-impl listening for HTTP on 0:0:0:0:0:0:0:0:51040
[info] Service a3-impl listening for HTTP on 0:0:0:0:0:0:0:0:49889
[info] (Services started, press enter to stop and go back to the console...)
[info] Stopping services
10:04:55.687 | pool-39-threa | INFO  | play.core.server.AkkaHttpServer - Stopping server...
10:04:55.689 [info] play.core.server.AkkaHttpServer [] - Stopping server...
10:04:55.692 | pool-39-threa | INFO  | play.core.server.AkkaHttpServer - Stopping server...
10:04:55.692 | pool-39-thread | INFO  | play.core.server.AkkaHttpServer - Stopping server...

So I do not press any key, it just directly stops. A workaround usually is to clean the whole project.

It is really annoying because it hinders productivity a lot.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
fkoehlercommented, Feb 27, 2018

Believe it or not but I was able to produce really simple basic testcase: https://github.com/fkoehler/lagom-sbt-java-console-read-bug

In that simple sbt project I just run either System.in.read() or System.console().readLine(). With System.console().readLine() everything works as expected.

With System.in.read() the call to run immediately returns the second time when I pressed ENTER already in the first run. So the output looks like this:

[info] Set current project to consoletest (in build file:/Users/fab/dev/consoletest/)
> run
[info] Running Main 
reading ....
sdfsafsdfsdf
done!
[success] Total time: 3 s, completed 27.02.2018 22:33:52
> run
[info] Running Main 
reading ....
done!
[success] Total time: 0 s, completed 27.02.2018 22:33:54

That’s exactly what I experience in Lagom. So System.console.readLine() seems to be more stable. Hard do write an automatic test I guess.

Is that enough to create a fix for this or is one person having the issue not good enough? Since it works exactly the same I think changing that one line would not be an issue? I would not mind creating a PR for that.

1reaction
fkoehlercommented, Feb 27, 2018

I can’t find anything related in terminal regarding those settings. Maybe I somehow enter that mode. I will keep investigating in that direction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service starts but immediately stops on Windows server - Web
The web applications itself works fine when I start it by double clicking its icon in Windows Explorer. But the app needs to...
Read more >
Service starts and then stops immediately.
Hi, I have a program that needs a service running to work. The service won't start automatically as it should and when I...
Read more >
long running py.test stop at first failure - Stack Overflow
Is there a programmatic way to tell pytest to stop running on the first failure as opposed to having to do this at...
Read more >
Run tests | IntelliJ IDEA Documentation - JetBrains
If your tests don't require any specific actions before start and you ... Place the caret at the test class to run all...
Read more >
GitLab Runner commands
This is main command that is executed when GitLab Runner is started as a service. It reads all defined runners from config.toml and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found