Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

GRAILS-9509 - improve reloading

There is a problem with stale JVM state that isn't cleared up properly on reload.  Spring Loaded is going to address this but for now the simplest thing for us to do is the change represented here in this commit.

See comments at http://jira.grails.org/browse/GRAILS-9509 for more info.
  • Loading branch information...
commit 963cc0b444f8ee2b5873e39effd140fa48f6cc05 1 parent 28da49a
Jeff Scott Brown jeffbrown authored
7 grails-core/src/main/groovy/org/codehaus/groovy/grails/cli/agent/GrailsPluginManagerReloadPlugin.java
@@ -20,6 +20,7 @@
20 20 import org.codehaus.groovy.grails.commons.ClassPropertyFetcher;
21 21 import org.codehaus.groovy.grails.compiler.GrailsProjectWatcher;
22 22 import org.springframework.beans.CachedIntrospectionResults;
  23 +import java.beans.Introspector;
23 24
24 25 /**
25 26 * Reloading agent plugin for use with the GrailsPluginManager.
@@ -37,11 +38,7 @@ public void reloadEvent(String typename, Class<?> aClass, String encodedTimestam
37 38 CachedIntrospectionResults.clearClassLoader(aClass.getClassLoader());
38 39 ClassPropertyFetcher.clearClassPropertyFetcherCache();
39 40 if (GrailsProjectWatcher.isActive()) {
40   - try {
41   - Thread.sleep(2500); // wait for a bit, to reduce chance of any concurrent issues with the timing of the reload reflecting in the JVM
42   - } catch (InterruptedException e) {
43   - // ignore
44   - }
  41 + Introspector.flushFromCaches(aClass);
45 42 GrailsProjectWatcher.firePendingClassChangeEvents(aClass);
46 43 }
47 44 }

0 comments on commit 963cc0b

Please sign in to comment.
Something went wrong with that request. Please try again.