As you can see isServerAvailable is called without any kind of rate limiting and consumes an entire core busy-waiting. This is especially bad if the server never starts because of an exception.
In the third row we see that isServerAvailable was called inside run-app.groovy
Here are the profiler results:
As you can see
isServerAvailable
is called without any kind of rate limiting and consumes an entire core busy-waiting. This is especially bad if the server never starts because of an exception.In the third row we see that
isServerAvailable
was called insiderun-app.groovy
https://github.com/grails-profiles/base/blob/master/commands/run-app.groovy#L86
Usually the
isServerAvailable
function is called with a small delay as you can see inwaitForStartup
waitForStartup
sleeps 100 milliseconds between every call toisServerAvailable
.https://github.com/grails/grails-core/blob/master/grails-shell/src/main/groovy/org/grails/cli/profile/commands/io/ServerInteraction.groovy
Please add
sleep 100
inside the while loop (https://github.com/grails-profiles/base/blob/master/commands/run-app.groovy#L86).I would submit a PR but I have no idea how to build this project to test if I applied the change correctly.