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

detectChange causes an erroneous log message in dev modeon Play start #1008

Closed
xael-fry opened this issue Oct 14, 2016 · 0 comments
Closed
Milestone

Comments

@xael-fry
Copy link
Member

Report by @selangley 1a0f924#commitcomment-19419445

This causes an erroneous log message in dev mode:
ERROR play - Restart: Need to restart Play because \application.conf has been changed

because when detectChange() is first executed the value of long configLastModified has not been properly initialized yet. It's value is 0. So the ConfigurationChangeWatcherPlugin will think a change has occurred to the application.conf when it it fact has not occurred. The value of configLastModified only gets initialized later when onConfigurationRead() is called.

Here is a snippet from my log file showing the order in which these methods were called:

17:51:19,355 INFO play:308 - detectChange()
java.lang.Throwable
at play.ConfigurationChangeWatcherPlugin.detectChange(ConfigurationChangeWatcherPlugin.java:24)
at play.plugins.PluginCollection.detectChange(PluginCollection.java:598)
at play.Play.detectChanges(Play.java:641)
at play.Invoker$Invocation.init(Invoker.java:199)
at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:264)
at play.Invoker$Invocation.run(Invoker.java:285)

17:51:19,474 INFO play:308 - onConfigurationRead()
java.lang.Throwable
at play.ConfigurationChangeWatcherPlugin.onConfigurationRead(ConfigurationChangeWatcherPlugin.java:14)
at play.plugins.PluginCollection.onConfigurationRead(PluginCollection.java:610)
at play.Play.readConfiguration(Play.java:356)
at play.Play.start(Play.java:489)
at play.Play.detectChanges(Play.java:659)
at play.Invoker$Invocation.init(Invoker.java:199)
at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:264)
at play.Invoker$Invocation.run(Invoker.java:285)
at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:303)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

@asolntsev asolntsev added this to the 1.4.4 milestone Oct 15, 2016
xael-fry added a commit to xael-fry/play that referenced this issue Oct 19, 2016
xael-fry added a commit to xael-fry/play that referenced this issue Oct 20, 2016
xael-fry added a commit that referenced this issue Oct 21, 2016
[#1008] fix(ConfigurationChangeWatcherPlugin): initialized configLastModified on application start
xael-fry added a commit that referenced this issue Oct 21, 2016
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

No branches or pull requests

2 participants