You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by John Wagenleitner <jo...@gmail.com> on 2016/09/18 23:49:49 UTC

Recent commit breaks gradle builds

A recent commit [1] to ClassInfo changed a private field from a Class to a
WeakReference<Class> (to address memory leaks).  In testing a project with
the latest snapshot as a dependency, the compileGroovy task fails [2]
because that field is referenced in an internal Gradle
class LeakyOnJava7GroovySystemLoader [3].

I haven't reported it yet on the Gradle forums yet, thought I'd post here
first since I know there's some Gradle folks on here to see what you
thought would be the best way to approach this (i.e., report, revert our
change, etc.).


[1]
https://github.com/apache/groovy/commit/a8fb776023253ebc2da35538f25eccd7d59997ed

[2] > Could not shut down the Groovy system for
org.gradle.internal.classloader.VisitableURLClassLoader@69048911
....
....
Caused by: java.lang.ClassCastException: java.lang.ref.WeakReference cannot
be cast to java.lang.Class
        at
org.gradle.api.internal.classloading.LeakyOnJava7GroovySystemLoader.shutdown(LeakyOnJava7GroovySystemLoader.java:74)

[3]
https://github.com/gradle/gradle/blob/711f64233b1b3ed312dee00f1215e2609ce41210/subprojects/core/src/main/java/org/gradle/api/internal/classloading/LeakyOnJava7GroovySystemLoader.java#L74

Fwd: Recent commit breaks gradle builds

Posted by John Wagenleitner <jo...@gmail.com>.
---------- Forwarded message ----------
From: Jochen Theodorou <bl...@gmx.org>
Date: Mon, Sep 19, 2016 at 12:12 AM
Subject: Re: Recent commit breaks gradle builds
To: dev@groovy.apache.org


On 19.09.2016 01:49, John Wagenleitner wrote:

> A recent commit [1] to ClassInfo changed a private field from a Class to
> a WeakReference<Class> (to address memory leaks).  In testing a project
> with the latest snapshot as a dependency, the compileGroovy task fails
> [2] because that field is referenced in an internal Gradle
> class LeakyOnJava7GroovySystemLoader [3].
>

right... hmm... I think we have to talk with Cedric about that. Unless he
is reading this and wants to answer, we better continue next week after
Java One.

bye Jochen


Ok.

One possible alternative would to be restore the klazz field and store the
weak ref in another, to retain compatibility in 2.4.x.  Something like this
seems to work

https://github.com/apache/groovy/pull/427

Re: Recent commit breaks gradle builds

Posted by Jochen Theodorou <bl...@gmx.org>.
On 19.09.2016 01:49, John Wagenleitner wrote:
> A recent commit [1] to ClassInfo changed a private field from a Class to
> a WeakReference<Class> (to address memory leaks).  In testing a project
> with the latest snapshot as a dependency, the compileGroovy task fails
> [2] because that field is referenced in an internal Gradle
> class LeakyOnJava7GroovySystemLoader [3].

right... hmm... I think we have to talk with Cedric about that. Unless 
he is reading this and wants to answer, we better continue next week 
after Java One.

bye Jochen

Re: Recent commit breaks gradle builds

Posted by John Wagenleitner <jo...@gmail.com>.
On Thu, Sep 29, 2016 at 8:27 AM, Cédric Champeau <ce...@gmail.com>
wrote:

> Nice, thanks John. Did you have a chance to test it with Gradle?
>


I did run the 'test' and 'soakTest' tasks on Gradle's master branch
configured for 2.4.8-SNAPSHOT and they were successful.  Though I am not
sure if those are the right tasks that would have exercised the use of the
LeakyOnJava7GroovySystemLoader.




>
> 2016-09-29 17:21 GMT+02:00 John Wagenleitner <jo...@gmail.com>
> :
>
>> On Wed, Sep 28, 2016 at 11:35 PM, Cédric Champeau <
>> cedric.champeau@gmail.com> wrote:
>>
>>> Ah that's annoying. We had to do this to workaround memory leaks with
>>> Groovy and Java 7 (and the name states). This change basically means that
>>> users will start seeing errors if they upgrade Groovy. Is it on `master` or
>>> 2.4.8? I would consider this a blocker for the release.
>>>
>>
>>
>> It was on master and 2_4_X.  A workaround has been since committed [1]
>> that restores compatibility and now projects build with 2.4.8-SNAPSHOT.
>>
>>
>> [1]  https://github.com/apache/groovy/commit/82c9d20a160c7e4f596
>> 30f163a68df82f5e0eba4
>>
>>
>>
>>>
>>> 2016-09-19 1:49 GMT+02:00 John Wagenleitner <john.wagenleitner@gmail.com
>>> >:
>>>
>>>> A recent commit [1] to ClassInfo changed a private field from a Class
>>>> to a WeakReference<Class> (to address memory leaks).  In testing a project
>>>> with the latest snapshot as a dependency, the compileGroovy task fails [2]
>>>> because that field is referenced in an internal Gradle
>>>> class LeakyOnJava7GroovySystemLoader [3].
>>>>
>>>> I haven't reported it yet on the Gradle forums yet, thought I'd post
>>>> here first since I know there's some Gradle folks on here to see what you
>>>> thought would be the best way to approach this (i.e., report, revert our
>>>> change, etc.).
>>>>
>>>>
>>>> [1] https://github.com/apache/groovy/commit/a8fb776023253ebc
>>>> 2da35538f25eccd7d59997ed
>>>>
>>>> [2] > Could not shut down the Groovy system for
>>>> org.gradle.internal.classloader.VisitableURLClassLoader@69048911
>>>> ....
>>>> ....
>>>> Caused by: java.lang.ClassCastException: java.lang.ref.WeakReference
>>>> cannot be cast to java.lang.Class
>>>>         at org.gradle.api.internal.classloading.LeakyOnJava7GroovySyste
>>>> mLoader.shutdown(LeakyOnJava7GroovySystemLoader.java:74)
>>>>
>>>> [3] https://github.com/gradle/gradle/blob/711f64233b1b3ed312
>>>> dee00f1215e2609ce41210/subprojects/core/src/main/java/org/gr
>>>> adle/api/internal/classloading/LeakyOnJava7GroovySystemLoader.java#L74
>>>>
>>>>
>>>
>>
>

Re: Recent commit breaks gradle builds

Posted by Cédric Champeau <ce...@gmail.com>.
Nice, thanks John. Did you have a chance to test it with Gradle?

2016-09-29 17:21 GMT+02:00 John Wagenleitner <jo...@gmail.com>:

> On Wed, Sep 28, 2016 at 11:35 PM, Cédric Champeau <
> cedric.champeau@gmail.com> wrote:
>
>> Ah that's annoying. We had to do this to workaround memory leaks with
>> Groovy and Java 7 (and the name states). This change basically means that
>> users will start seeing errors if they upgrade Groovy. Is it on `master` or
>> 2.4.8? I would consider this a blocker for the release.
>>
>
>
> It was on master and 2_4_X.  A workaround has been since committed [1]
> that restores compatibility and now projects build with 2.4.8-SNAPSHOT.
>
>
> [1]  https://github.com/apache/groovy/commit/
> 82c9d20a160c7e4f59630f163a68df82f5e0eba4
>
>
>
>>
>> 2016-09-19 1:49 GMT+02:00 John Wagenleitner <jo...@gmail.com>
>> :
>>
>>> A recent commit [1] to ClassInfo changed a private field from a Class to
>>> a WeakReference<Class> (to address memory leaks).  In testing a project
>>> with the latest snapshot as a dependency, the compileGroovy task fails [2]
>>> because that field is referenced in an internal Gradle
>>> class LeakyOnJava7GroovySystemLoader [3].
>>>
>>> I haven't reported it yet on the Gradle forums yet, thought I'd post
>>> here first since I know there's some Gradle folks on here to see what you
>>> thought would be the best way to approach this (i.e., report, revert our
>>> change, etc.).
>>>
>>>
>>> [1] https://github.com/apache/groovy/commit/a8fb776023253ebc
>>> 2da35538f25eccd7d59997ed
>>>
>>> [2] > Could not shut down the Groovy system for
>>> org.gradle.internal.classloader.VisitableURLClassLoader@69048911
>>> ....
>>> ....
>>> Caused by: java.lang.ClassCastException: java.lang.ref.WeakReference
>>> cannot be cast to java.lang.Class
>>>         at org.gradle.api.internal.classloading.LeakyOnJava7GroovySyste
>>> mLoader.shutdown(LeakyOnJava7GroovySystemLoader.java:74)
>>>
>>> [3] https://github.com/gradle/gradle/blob/711f64233b1b3ed312
>>> dee00f1215e2609ce41210/subprojects/core/src/main/java/org/
>>> gradle/api/internal/classloading/LeakyOnJava7GroovySystemLoader.java#L74
>>>
>>>
>>
>

Re: Recent commit breaks gradle builds

Posted by John Wagenleitner <jo...@gmail.com>.
On Wed, Sep 28, 2016 at 11:35 PM, Cédric Champeau <cedric.champeau@gmail.com
> wrote:

> Ah that's annoying. We had to do this to workaround memory leaks with
> Groovy and Java 7 (and the name states). This change basically means that
> users will start seeing errors if they upgrade Groovy. Is it on `master` or
> 2.4.8? I would consider this a blocker for the release.
>


It was on master and 2_4_X.  A workaround has been since committed [1] that
restores compatibility and now projects build with 2.4.8-SNAPSHOT.


[1]
https://github.com/apache/groovy/commit/82c9d20a160c7e4f59630f163a68df82f5e0eba4



>
> 2016-09-19 1:49 GMT+02:00 John Wagenleitner <jo...@gmail.com>:
>
>> A recent commit [1] to ClassInfo changed a private field from a Class to
>> a WeakReference<Class> (to address memory leaks).  In testing a project
>> with the latest snapshot as a dependency, the compileGroovy task fails [2]
>> because that field is referenced in an internal Gradle
>> class LeakyOnJava7GroovySystemLoader [3].
>>
>> I haven't reported it yet on the Gradle forums yet, thought I'd post here
>> first since I know there's some Gradle folks on here to see what you
>> thought would be the best way to approach this (i.e., report, revert our
>> change, etc.).
>>
>>
>> [1] https://github.com/apache/groovy/commit/a8fb776023253ebc
>> 2da35538f25eccd7d59997ed
>>
>> [2] > Could not shut down the Groovy system for
>> org.gradle.internal.classloader.VisitableURLClassLoader@69048911
>> ....
>> ....
>> Caused by: java.lang.ClassCastException: java.lang.ref.WeakReference
>> cannot be cast to java.lang.Class
>>         at org.gradle.api.internal.classloading.LeakyOnJava7GroovySyste
>> mLoader.shutdown(LeakyOnJava7GroovySystemLoader.java:74)
>>
>> [3] https://github.com/gradle/gradle/blob/711f64233b1b3ed312
>> dee00f1215e2609ce41210/subprojects/core/src/main/
>> java/org/gradle/api/internal/classloading/LeakyOnJava7Groov
>> ySystemLoader.java#L74
>>
>>
>

Re: Recent commit breaks gradle builds

Posted by Cédric Champeau <ce...@gmail.com>.
Ah that's annoying. We had to do this to workaround memory leaks with
Groovy and Java 7 (and the name states). This change basically means that
users will start seeing errors if they upgrade Groovy. Is it on `master` or
2.4.8? I would consider this a blocker for the release.

2016-09-19 1:49 GMT+02:00 John Wagenleitner <jo...@gmail.com>:

> A recent commit [1] to ClassInfo changed a private field from a Class to a
> WeakReference<Class> (to address memory leaks).  In testing a project with
> the latest snapshot as a dependency, the compileGroovy task fails [2]
> because that field is referenced in an internal Gradle class LeakyOnJava7GroovySystemLoader
> [3].
>
> I haven't reported it yet on the Gradle forums yet, thought I'd post here
> first since I know there's some Gradle folks on here to see what you
> thought would be the best way to approach this (i.e., report, revert our
> change, etc.).
>
>
> [1] https://github.com/apache/groovy/commit/a8fb776023253ebc2da35538f25ecc
> d7d59997ed
>
> [2] > Could not shut down the Groovy system for org.gradle.internal.
> classloader.VisitableURLClassLoader@69048911
> ....
> ....
> Caused by: java.lang.ClassCastException: java.lang.ref.WeakReference
> cannot be cast to java.lang.Class
>         at org.gradle.api.internal.classloading.
> LeakyOnJava7GroovySystemLoader.shutdown(LeakyOnJava7GroovySystemLoader
> .java:74)
>
> [3] https://github.com/gradle/gradle/blob/711f64233b1b3ed312dee00f1215e2
> 609ce41210/subprojects/core/src/main/java/org/gradle/api/
> internal/classloading/LeakyOnJava7GroovySystemLoader.java#L74
>
>