daniel_sun
07/12/2025, 11:22 AMdaniel_sun
07/12/2025, 11:23 AMSujith
07/12/2025, 9:52 PMgroovyConsole
to prepare code demos for a presentation to a local meetup. Quite a few times, the application would just freeze up and had to be forcefully shutdown. Seems like there is a memory leak?Sujith
07/12/2025, 9:54 PMSujith
07/12/2025, 9:56 PMgroovysh
throws a bunch of deprecation warnings during start up. This was with Groovy 4 on JDK 17.daniel_sun
07/13/2025, 5:44 AMSujith
07/23/2025, 4:33 PMSaravanan Subiramaniam
08/09/2025, 4:43 PMVampire
08/12/2025, 3:26 PMThread.start {
new AutoCloseable() { void close() {} }.withCloseable {
return
}
println("not to be displayed")
}.join()
How do I return
from the start
closure, not the withCloseable
closure, so that the out line is not displayed?Sujith
08/18/2025, 11:14 PMpaulk_asert
08/19/2025, 12:29 AMChristoph Obexer
08/20/2025, 8:52 AMPaul Bandler
08/27/2025, 4:51 PMThread 'http-nio-0.0.0.0-8080-exec-1' with ID = 74
jdk.internal.misc.Unsafe.park(Unsafe.java)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:885)
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:917)
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1240)
org.codehaus.groovy.util.LockableObject.lock(LockableObject.java:38)
org.codehaus.groovy.reflection.ClassInfo.lock(ClassInfo.java:393)
org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:313)
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:258)
org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:1066)
org.codehaus.groovy.runtime.DefaultGroovyMethods.newInstance(DefaultGroovyMethods.java:18029)
org.grails.datastore.gorm.validation.constraints.factory.DefaultConstraintFactory.build(DefaultConstraintFactory.groovy:55)
grails.gorm.validation.DefaultConstrainedProperty.instantiateConstraint(DefaultConstrainedProperty.groovy:692)
grails.gorm.validation.DefaultConstrainedProperty.applyConstraint(DefaultConstrainedProperty.groovy:651)
org.grails.datastore.gorm.validation.constraints.builder.ConstrainedPropertyBuilder.createNode(ConstrainedPropertyBuilder.java:150)
groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:90)
org.grails.datastore.gorm.validation.constraints.builder.ConstrainedPropertyBuilder.doInvokeMethod(ConstrainedPropertyBuilder.java:63)
groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:74)
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:424)
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:348)
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:61)
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
The system was otherwise completely quiescent, and it was a long time (10's of minutes) between abandoning the test to getting around to digging the above stack trace out. It did eventually 'go away', as after a very long time I noticed the CPU utilisation had dropped down to almost nothing, and so I took another heap-dump and noticed all the http-nio threads were neatly parked, quiescent.
So my question for groovy/gorm experts is, what could cause such lock contention? Has there ever been such issues in the core of Groovy around meta-class locking in the past that might provide some clues?
Note, that when the same application is run 'at full speed', on the same Apple silicon, no issues arise, and indeed even at 1.5CPUs I think it runs ok - it's as if, below some threshold value, some kind of 'busy-wait-retry' mechanism is spinning the CPU it has, but not achieving the condition it needs to 'unlock'...?
Thanks in anticipation for any ideas and suggestions.
Regards,
PaulBThomas Rasmussen
09/02/2025, 8:16 PMDate.parse('yyyy-MMM', '2011-Okt')
java.text.ParseException: Unparseable date: "2011-Okt"
Java changed date parsing in Java 9, I have found answers suggesting setting -Djava.locale.providers=COMPAT,SPI,CLDR
should bring back support for Java 8 formats - but it doesn't seam to work...
Will I have to rewrite the code, or is there a JVM setting I am missing?Vampire
09/19/2025, 8:42 AMsuper
calls differently and that code compiled with Groovy 3 misses runtime code for locating them.
That would be quite a breaking change making many Groovy 3 compiled code unusable on Groovy 4. 😕
I don't find something about super
in the Groovy 4 release notes.
For example quite some Gradle plugins are written in Groovy and will break now with Gradle 9 which embeds Groovy 4 if they are not being recompiled and then either released with two variants or drop support for Gradle <9. 😕paulk_asert
09/19/2025, 11:28 AMVampire
09/19/2025, 11:56 AMsuper....
call is different when compiled with 4 vs 3 but 4 requires the new one no-matter what and a CompileStatic
helps if possible.
But to me it is really concerning tbh. that there is such a big breaking change that makes many Groovy-compiled libraries unusable and then it did not even make it to the release notes. 😕
Of course it would be better to use CompileStatic
in all library or plugin code anyway, and if only for runtime speed, but I'd bet there are also many out there that do not use it. 😕Vampire
09/19/2025, 12:36 PMpaulk_asert
09/21/2025, 10:04 PMVampire
10/04/2025, 11:51 AMtrait Foo {
def foo(Object o) {
println("foo(o)")
}
def foo(Map<String, Object> m) {
println("foo(m)")
}
}
class Bar implements Foo {
def bar(Object o) {
println("bar(o)")
}
def bar(Map<String, Object> m) {
println("bar(m)")
}
}
new Bar().with {
foo((Object) null)
foo(null as Object)
bar((Object) null)
bar(null as Object)
}
In Groovy 2.5, 3.0 and 4.0 bar
uses the Object
variant as expected, but foo
uses the Map
variant for some reason.
This most probably was a bug, because in Groovy 5.0 now both use the Object
variant as expected.
Is there any way to get the right behavior also with 2.5 - 4.0?
(Context: Due to the inability to call the package-private methods in Groovy 5 anymore, I'm trying to move all the ...Impl
methods to a trait and coerce the Specification
to that trait to call the ...Impl
methods,
so that I don't have to broaden the method visibility and thus pollute IDE completions for Specifications with implementation details that only get used through AST transformation. I was quite successful until there happened to be a test that does exactly the shown and now fails with a NullPointerException
as the Map
argument is expected to be non-null
.)bsdooby
10/06/2025, 8:37 AMVampire
10/06/2025, 10:53 PMMixin
) written in Java, that is used as a mixin
for another class (Mixedinto
) written in Java, how do I (Mixin
) coerce this
to the instance I am mixed into (Mixedinto
)?
If the Mixin
class would be Groovy, I would just do this as Mixedinto
and it works.
So I thought I should be able to use DefaultGroovyMethods.asType(this, Mixedinot.class)
, but that does give a GroovyCastException
. 😞Vampire
10/08/2025, 12:27 PMjava.lang.IncompatibleClassChangeError: Type spock.util.AstNodeToScriptVisitor$_visitClass_closure11$_closure49 is not a nest member of spock.util.AstNodeToScriptVisitor: current type is not listed as a nest member
That was with Java 11.
With Java 17 it changes to
java.lang.IllegalAccessError: class spock.util.AstNodeToScriptVisitor$_visitClass_closure11$_closure49 tried to access private method 'void spock.util.AstNodeToScriptVisitor.visitObjectInitializerBlocks(org.codehaus.groovy.ast.ClassNode)' (spock.util.AstNodeToScriptVisitor$_visitClass_closure11$_closure49 and spock.util.AstNodeToScriptVisitor are in unnamed module of loader 'app'), (Type spock.util.AstNodeToScriptVisitor$_visitClass_closure11$_closure49 (loader: 'app') is not a nest member of type spock.util.AstNodeToScriptVisitor (loader: 'app'): current type is not listed as a nest member)
which makes even less sense.
A Closure in a class is not allowed to call a private
method in that class? o_Opaulk_asert
10/08/2025, 10:13 PMVampire
10/08/2025, 10:21 PMpaulk_asert
10/09/2025, 1:48 AMpaulk_asert
10/09/2025, 1:48 AMVampire
10/09/2025, 2:21 PM5.0.2-SNAPSHOT
as available on https://repository.apache.org/content/repositories/snapshots/Vampire
10/09/2025, 4:58 PMVampire
10/10/2025, 12:25 AMExpandoMetaClass
of Specification
does have the methods from the mixin.
Though I'm standing at a breakpoint in (Groovy 3 right now) groovy.lang.MetaClassImpl#getMethodWithCachingInternal
.
In the working process the metaMethodIndex.table
does have an entry for the mixin method.
In the broken process it is missing.
Any idea someone how to find out what is going wrong here / where to debug best?