You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "codeconsole (via GitHub)" <gi...@apache.org> on 2026/08/24 02:28:25 UTC
[PR] Leave a raw collection's elements alone rather than binding them into Object [grails-core]
codeconsole opened a new pull request, #16209:
URL: https://github.com/apache/grails-core/pull/16209
### Problem
A domain property declared as a **raw** collection loses its data during binding on 8.0.0-M6. Given:
```groovy
class TopicType {
List statusFilters = [] // no type argument
}
new TopicType(statusFilters: [[label: 'Answered', param: 'status=resolved']])
```
every map element is replaced by an empty `new java.lang.Object()`. With GORM for MongoDB the write then fails:
```
org.bson.codecs.configuration.CodecConfigurationException:
Can't find a codec for CodecCacheKey{clazz=class java.lang.Object, types=null}
at CodecExtensions$ListCodec.encode(CodecExtensions.groovy:362)
at BasicCollectionTypeEncoder.encode(BasicCollectionTypeEncoder.groovy:64)
at BsonPersistentEntityCodec.encode(BsonPersistentEntityCodec.groovy:229)
```
The exception is incidental — it is the first thing to notice that the elements are no longer maps. Without a codec in the path the empty objects would simply be persisted, so the data is lost either way. This worked on 8.0.0-M5.
### Cause
#15947 changed collection binding so that a `Map` element is instantiated as the component type and bound through the allowlist, rather than passed to a map constructor:
```diff
- itemsWhichNeedBinding << item
+ def instance = instantiateAndBindNestedOrUseMapConstructor(referencedType, item, itemBindingSource, ...)
+ if (instance != null) { itemsWhichNeedBinding << instance }
```
That is correct for a real nested type, but the component type is not always one. `Basic#componentType` falls back to `Object.class` when a property carries no generic signature, so a raw collection arrives with `referencedType == Object`. `Object` has a public no-arg constructor, so `getDeclaredConstructor().newInstance()` succeeds, and `Object` declares no properties, so `bindNested` has nowhere to put the map's contents.
This also escapes the opt-in. The instantiation is in the `try`, while `isDenyByDefaultEnabled()` guards only the map-constructor fallback in the `catch` — so an application that never set `grails.databinding.legacyBindableDefault=false` still loses the data, contrary to #15947's stated intent that unconfigured applications keep binding permissively.
### Fix
Treat `Object` (and `null`) as "not a nested type" and keep the element as it stands:
```groovy
if (referencedType == null || referencedType == Object) {
return value
}
```
Nothing can be mass-assigned through a value that is never used as a property source, so the hardening loses nothing: every other component type still instantiates and binds through the allowlist, and `bindable: false` is unaffected. Applied to `GrailsWebDataBinder` and to `SimpleDataBinder`, which is exposed to the same value because `getReferencedTypeForCollection` is overridden by the GORM-aware subclass and dispatches virtually from `SimpleDataBinder`'s own collection paths.
### Tests
Adds a regression test to `GrailsWebDataBinderSpec` (with a `RawCollectionContainer` domain). It fails on unmodified `8.0.x` with exactly the production symptom:
```
[java.lang.Object@7c79f2cf, java.lang.Object@63551c66]
```
and passes with the fix. `:grails-databinding-core:test`, `:grails-web-databinding:test` (including `DenyByDefaultConfigSpec`) and the `grails.web.databinding.*` suite in `grails-test-suite-persistence` are all green.
Also verified end to end against the real application that hit this: with these two jars built at `8.0.0-M6` and substituted into an otherwise stock M6 app, the raw-collection domain that previously failed now boots and persists its maps intact.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5391487467
## 🚨 TestLens detected 1 failed test 🚨
Here is what you can do:
1) Inspect the test failures carefully.
2) If you are convinced that some of the tests are flaky, you can mute them below.
3) Finally, trigger a rerun by checking the rerun checkbox.
### Test Summary
#### [CI / Functional Tests \(Java 21, indy\=false\)](https://github.com/apache/grails-core/actions/runs/32693101885/job/97330263973?pr=16209) > :grails-test-examples-scaffolding:integrationTest
| Test | Runs | Flakiness |
|---|---|--:|
| UserControllerSpec > User list | ❌ | [1% 🟡](https://github.com/apache/grails-core/issues/16030) |
🏷️ Commit: cf5c82d03155f9914b1c8ae8378015f0c5208ce5
▶️ Tests: 59772 executed
🟡 Checks: 75/84 completed
### Test Failures
<details>
<summary><strong>UserControllerSpec > User list</strong> (:grails-test-examples-scaffolding:integrationTest in <a href="https://github.com/apache/grails-core/actions/runs/32693101885/job/97330263973?pr=16209">CI / Functional Tests (Java 21, indy=false)</a>)</summary>
```
geb.waiting.WaitTimeoutException: condition did not pass in 30 seconds (failed with exception)
at geb.waiting.Wait.waitFor(Wait.groovy:128)
at geb.waiting.DefaultWaitingSupport.doWaitFor(DefaultWaitingSupport.groovy:55)
at geb.waiting.DefaultWaitingSupport.waitFor(DefaultWaitingSupport.groovy:41)
at geb.Page.waitFor(Page.groovy:120)
at com.example.pages.LoginPage.login(LoginPage.groovy:39)
at com.example.UserControllerSpec.User list(UserControllerSpec.groovy:48)
Caused by: Assertion failed:
title != pageTitle && $('input', name: 'username').empty
| | | |
| | | false
| | 'Please sign in'
| false
'Please sign in'
at com.example.pages.LoginPage.login_closure1(LoginPage.groovy:39)
at com.example.pages.LoginPage.login_closure1(LoginPage.groovy)
at geb.waiting.Wait.waitFor(Wait.groovy:117)
... 5 more
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 UserControllerSpec > User list <!-- uniqueId=[engine:spock]/[spec:com.example.UserControllerSpec]/[feature:$spock_feature_1_0] -->
Reuse successful test results:
🔲 ♻️ Only rerun the tests that failed or were muted before
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#discussion_r3842410669
##########
grails-web-databinding/src/main/groovy/grails/web/databinding/GrailsWebDataBinder.groovy:
##########
@@ -545,7 +545,17 @@ class GrailsWebDataBinder extends SimpleDataBinder {
}
}
if (persistentInstance == null) {
- if (item instanceof Map || item instanceof DataBindingSource) {
+ if (item == null || referencedType.isAssignableFrom(item.getClass())) {
Review Comment:
IntelliJ complains: "Cannot resolve symbol 'getClass'"
`inferred type: ?`
```suggestion
if (item == null || referencedType.isAssignableFrom((Object) item.getClass())) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole commented on code in PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#discussion_r3847658952
##########
grails-web-databinding/src/main/groovy/grails/web/databinding/GrailsWebDataBinder.groovy:
##########
@@ -545,7 +545,17 @@ class GrailsWebDataBinder extends SimpleDataBinder {
}
}
if (persistentInstance == null) {
- if (item instanceof Map || item instanceof DataBindingSource) {
+ if (item == null || referencedType.isAssignableFrom(item.getClass())) {
Review Comment:
Pushed as `f408864` — `def listValue` → `List listValue` on line 508, where the value is introduced. That leaves `item.getClass()` uncast, matching the array branch above and the Map branch below.
Thanks for catching it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5390765574
## 🚨 TestLens detected 4 failed tests 🚨
Here is what you can do:
1) Inspect the test failures carefully.
2) If you are convinced that some of the tests are flaky, you can mute them below.
3) Finally, trigger a rerun by checking the rerun checkbox.
### Test Summary
#### [CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot \(shard 1\)](https://github.com/apache/grails-core/actions/runs/32688338338/job/97318767673?pr=16209) > :grails-data-mongodb-core:test
| Test | Runs | Flakiness |
|---|---|--:|
| MongoTransactionSpec > test a committed transaction persists all writes atomically | ❌ | [5% 🟠](https://github.com/apache/grails-core/issues/16030) |
| MongoTransactionSpec > test a rolled back transaction discards all writes on the server | ❌ | [5% 🟠](https://github.com/apache/grails-core/issues/16030) |
| MongoTransactionSpec > test read-your-writes within an active transaction | ❌ | [5% 🟠](https://github.com/apache/grails-core/issues/16030) |
| MongoTransactionSpec > test writes across multiple collections roll back together | ❌ | [5% 🟠](https://github.com/apache/grails-core/issues/16030) |
🏷️ Commit: a4c7442d4ef0b917f92760b71051fc019f0a0260
▶️ Tests: 35296 executed
🟡 Checks: 39/83 completed
### Test Failures
<details>
<summary><strong>MongoTransactionSpec > test a committed transaction persists all writes atomically</strong> (:grails-data-mongodb-core:test in <a href="https://github.com/apache/grails-core/actions/runs/32688338338/job/97318767673?pr=16209">CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot (shard 1)</a>)</summary>
```
com.mongodb.MongoSocketReadException: Prematurely reached end of stream
at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:184)
at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:1081)
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandResponseBuffers(InternalStreamConnection.java:589)
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:569)
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceiveInternal(InternalStreamConnection.java:496)
at com.mongodb.internal.connection.InternalStreamConnection.lambda$sendAndReceive$1(InternalStreamConnection.java:385)
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:388)
at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:111)
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:757)
at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:60)
at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:207)
at com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:112)
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:82)
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:74)
at com.mongodb.internal.connection.DefaultServer$OperationCountTrackingConnection.command(DefaultServer.java:297)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$executeRetryableWrite$11(SyncOperationHelper.java:285)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$withSourceAndConnection$1(SyncOperationHelper.java:146)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:177)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$withSourceAndConnection$2(SyncOperationHelper.java:142)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:177)
at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:138)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$executeRetryableWrite$12(SyncOperationHelper.java:270)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$decorateWriteWithRetries$13(SyncOperationHelper.java:329)
at com.mongodb.internal.async.function.RetryingSyncSupplier.get(RetryingSyncSupplier.java:67)
at com.mongodb.internal.operation.SyncOperationHelper.executeRetryableWrite(SyncOperationHelper.java:297)
at com.mongodb.internal.operation.BaseFindAndModifyOperation.execute(BaseFindAndModifyOperation.java:81)
at com.mongodb.client.internal.MongoClusterImpl$OperationExecutorImpl.execute(MongoClusterImpl.java:474)
at com.mongodb.client.internal.MongoCollectionImpl.executeFindOneAndUpdate(MongoCollectionImpl.java:787)
at com.mongodb.client.internal.MongoCollectionImpl.findOneAndUpdate(MongoCollectionImpl.java:766)
at org.grails.datastore.mapping.mongo.engine.MongoCodecEntityPersister.generateIdentifier(MongoCodecEntityPersister.groovy:443)
at org.grails.datastore.mapping.mongo.engine.MongoCodecEntityPersister.persistEntity(MongoCodecEntityPersister.groovy:226)
at org.grails.datastore.mapping.mongo.engine.MongoCodecEntityPersister.persistEntity(MongoCodecEntityPersister.groovy:567)
at org.grails.datastore.mapping.engine.EntityPersister.persist(EntityPersister.java:188)
at org.grails.datastore.mapping.core.AbstractSession.persist(AbstractSession.java:609)
at org.grails.datastore.gorm.GormInstanceApi.save_closure5(GormInstanceApi.groovy:213)
at org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:334)
at org.grails.datastore.gorm.AbstractGormApi.execute(AbstractGormApi.groovy:164)
at org.grails.datastore.gorm.GormInstanceApi.save(GormInstanceApi.groovy:206)
at org.grails.datastore.gorm.GormInstanceApi.save(GormInstanceApi.groovy:173)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.save(GormEntity.groovy:110)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.test a committed transaction persists all writes atomically_closure2(MongoTransactionSpec.groovy:73)
at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:103)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:100)
at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:703)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.withTransaction(GormEntity.groovy:1066)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.test a committed transaction persists all writes atomically(MongoTransactionSpec.groovy:71)
```
</details>
<details>
<summary><strong>MongoTransactionSpec > test a rolled back transaction discards all writes on the server</strong> (:grails-data-mongodb-core:test in <a href="https://github.com/apache/grails-core/actions/runs/32688338338/job/97318767673?pr=16209">CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot (shard 1)</a>)</summary>
```
com.mongodb.MongoTimeoutException: Timed out while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:32833, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
at com.mongodb.internal.connection.BaseCluster.logAndThrowTimeoutException(BaseCluster.java:431)
at com.mongodb.internal.connection.BaseCluster.lambda$selectServer$0(BaseCluster.java:166)
at com.mongodb.internal.time.Timeout.lambda$onExistsAndExpired$16(Timeout.java:238)
at com.mongodb.internal.time.Timeout.lambda$run$10(Timeout.java:203)
at com.mongodb.internal.time.TimePoint.checkedCall(TimePoint.java:100)
at com.mongodb.internal.time.Timeout.call(Timeout.java:176)
at com.mongodb.internal.time.Timeout.run(Timeout.java:196)
at com.mongodb.internal.time.Timeout.onExistsAndExpired(Timeout.java:235)
at com.mongodb.internal.time.Timeout.onExpired(Timeout.java:228)
at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:165)
at com.mongodb.internal.connection.SingleServerCluster.selectServer(SingleServerCluster.java:47)
at com.mongodb.internal.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:91)
at com.mongodb.client.internal.ClientSessionBinding.getConnectionSource(ClientSessionBinding.java:109)
at com.mongodb.client.internal.ClientSessionBinding.getWriteConnectionSource(ClientSessionBinding.java:102)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:169)
at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:138)
at com.mongodb.internal.operation.SyncOperationHelper.withConnection(SyncOperationHelper.java:117)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:73)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:48)
at com.mongodb.client.internal.MongoClusterImpl$OperationExecutorImpl.execute(MongoClusterImpl.java:474)
at com.mongodb.client.internal.MongoDatabaseImpl.executeDrop(MongoDatabaseImpl.java:230)
at com.mongodb.client.internal.MongoDatabaseImpl.drop(MongoDatabaseImpl.java:220)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup_closure1(MongoTransactionSpec.groovy:58)
at org.grails.datastore.gorm.GormStaticApi.withNewSession_closure23(GormStaticApi.groovy:767)
at org.grails.datastore.mapping.core.DatastoreUtils.executeWithNewSession(DatastoreUtils.java:371)
at org.grails.datastore.gorm.GormStaticApi.withNewSession(GormStaticApi.groovy:766)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.withNewSession(GormEntity.groovy:1157)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup(MongoTransactionSpec.groovy:57)
```
</details>
<details>
<summary><strong>MongoTransactionSpec > test read-your-writes within an active transaction</strong> (:grails-data-mongodb-core:test in <a href="https://github.com/apache/grails-core/actions/runs/32688338338/job/97318767673?pr=16209">CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot (shard 1)</a>)</summary>
```
com.mongodb.MongoTimeoutException: Timed out while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:32833, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
at com.mongodb.internal.connection.BaseCluster.logAndThrowTimeoutException(BaseCluster.java:431)
at com.mongodb.internal.connection.BaseCluster.lambda$selectServer$0(BaseCluster.java:166)
at com.mongodb.internal.time.Timeout.lambda$onExistsAndExpired$16(Timeout.java:238)
at com.mongodb.internal.time.Timeout.lambda$run$10(Timeout.java:203)
at com.mongodb.internal.time.TimePoint.checkedCall(TimePoint.java:100)
at com.mongodb.internal.time.Timeout.call(Timeout.java:176)
at com.mongodb.internal.time.Timeout.run(Timeout.java:196)
at com.mongodb.internal.time.Timeout.onExistsAndExpired(Timeout.java:235)
at com.mongodb.internal.time.Timeout.onExpired(Timeout.java:228)
at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:165)
at com.mongodb.internal.connection.SingleServerCluster.selectServer(SingleServerCluster.java:47)
at com.mongodb.internal.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:91)
at com.mongodb.client.internal.ClientSessionBinding.getConnectionSource(ClientSessionBinding.java:109)
at com.mongodb.client.internal.ClientSessionBinding.getWriteConnectionSource(ClientSessionBinding.java:102)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:169)
at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:138)
at com.mongodb.internal.operation.SyncOperationHelper.withConnection(SyncOperationHelper.java:117)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:73)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:48)
at com.mongodb.client.internal.MongoClusterImpl$OperationExecutorImpl.execute(MongoClusterImpl.java:474)
at com.mongodb.client.internal.MongoDatabaseImpl.executeDrop(MongoDatabaseImpl.java:230)
at com.mongodb.client.internal.MongoDatabaseImpl.drop(MongoDatabaseImpl.java:220)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup_closure1(MongoTransactionSpec.groovy:58)
at org.grails.datastore.gorm.GormStaticApi.withNewSession_closure23(GormStaticApi.groovy:767)
at org.grails.datastore.mapping.core.DatastoreUtils.executeWithNewSession(DatastoreUtils.java:371)
at org.grails.datastore.gorm.GormStaticApi.withNewSession(GormStaticApi.groovy:766)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.withNewSession(GormEntity.groovy:1157)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup(MongoTransactionSpec.groovy:57)
```
</details>
<details>
<summary><strong>MongoTransactionSpec > test writes across multiple collections roll back together</strong> (:grails-data-mongodb-core:test in <a href="https://github.com/apache/grails-core/actions/runs/32688338338/job/97318767673?pr=16209">CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot (shard 1)</a>)</summary>
```
com.mongodb.MongoTimeoutException: Timed out while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:32833, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
at com.mongodb.internal.connection.BaseCluster.logAndThrowTimeoutException(BaseCluster.java:431)
at com.mongodb.internal.connection.BaseCluster.lambda$selectServer$0(BaseCluster.java:166)
at com.mongodb.internal.time.Timeout.lambda$onExistsAndExpired$16(Timeout.java:238)
at com.mongodb.internal.time.Timeout.lambda$run$10(Timeout.java:203)
at com.mongodb.internal.time.TimePoint.checkedCall(TimePoint.java:100)
at com.mongodb.internal.time.Timeout.call(Timeout.java:176)
at com.mongodb.internal.time.Timeout.run(Timeout.java:196)
at com.mongodb.internal.time.Timeout.onExistsAndExpired(Timeout.java:235)
at com.mongodb.internal.time.Timeout.onExpired(Timeout.java:228)
at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:165)
at com.mongodb.internal.connection.SingleServerCluster.selectServer(SingleServerCluster.java:47)
at com.mongodb.internal.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:91)
at com.mongodb.client.internal.ClientSessionBinding.getConnectionSource(ClientSessionBinding.java:109)
at com.mongodb.client.internal.ClientSessionBinding.getWriteConnectionSource(ClientSessionBinding.java:102)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:169)
at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:138)
at com.mongodb.internal.operation.SyncOperationHelper.withConnection(SyncOperationHelper.java:117)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:73)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:48)
at com.mongodb.client.internal.MongoClusterImpl$OperationExecutorImpl.execute(MongoClusterImpl.java:474)
at com.mongodb.client.internal.MongoDatabaseImpl.executeDrop(MongoDatabaseImpl.java:230)
at com.mongodb.client.internal.MongoDatabaseImpl.drop(MongoDatabaseImpl.java:220)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup_closure1(MongoTransactionSpec.groovy:58)
at org.grails.datastore.gorm.GormStaticApi.withNewSession_closure23(GormStaticApi.groovy:767)
at org.grails.datastore.mapping.core.DatastoreUtils.executeWithNewSession(DatastoreUtils.java:371)
at org.grails.datastore.gorm.GormStaticApi.withNewSession(GormStaticApi.groovy:766)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.withNewSession(GormEntity.groovy:1157)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup(MongoTransactionSpec.groovy:57)
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 MongoTransactionSpec > test a committed transaction persists all writes atomically <!-- uniqueId=[engine:spock]/[spec:org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec]/[feature:$spock_feature_1_1] -->
🔲 MongoTransactionSpec > test a rolled back transaction discards all writes on the server <!-- uniqueId=[engine:spock]/[spec:org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec]/[feature:$spock_feature_1_2] -->
🔲 MongoTransactionSpec > test read-your-writes within an active transaction <!-- uniqueId=[engine:spock]/[spec:org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec]/[feature:$spock_feature_1_4] -->
🔲 MongoTransactionSpec > test writes across multiple collections roll back together <!-- uniqueId=[engine:spock]/[spec:org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec]/[feature:$spock_feature_1_3] -->
Reuse successful test results:
🔲 ♻️ Only rerun the tests that failed or were muted before
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5400617876
Exception downstream
```
org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for CodecCacheKey{clazz=class java.lang.Object, types=null}.
at org.bson.internal.ProvidersCodecRegistry.lambda$get$0(ProvidersCodecRegistry.java:86)
at org.bson.internal.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:79)
at org.bson.internal.ChildCodecRegistry.get(ChildCodecRegistry.java:68)
at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63)
at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29)
at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63)
at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5401592509
@matrei if I change
```groovy
def listValue
```
to
```groovy
List listValue
```
it get's rid of
```
Cannot resolve symbol 'getClass'
```
but I still have the existing
```
Expected '?', found 'grails.databinding.TypedStructuredBindingEditor'
Expected '?', found 'grails.databinding.converters.ValueConverter'
Expected '?', found 'grails.databinding.converters.FormattedValueConverter'
```
So I am just trying to understand why IntellJ complains about things gradle or the groovy compiler does not.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5402310575
## 🚨 TestLens detected 1 failed test 🚨
Here is what you can do:
1) Inspect the test failures carefully.
2) If you are convinced that some of the tests are flaky, you can mute them below.
3) Finally, trigger a rerun by checking the rerun checkbox.
### Test Summary
#### [CI / Functional Tests \(Java 25, indy\=false\)](https://github.com/apache/grails-core/actions/runs/32780264043/job/97600561629?pr=16209) > :grails-test-examples-scaffolding:integrationTest
| Test | Runs | Flakiness |
|---|---|--:|
| UserControllerSpec > User list | ❌ | [1% 🟡](https://github.com/apache/grails-core/issues/16030) |
🏷️ Commit: f4088648f07cf64cf095d427aa4bb934ba7450ea
▶️ Tests: 59633 executed
🟡 Checks: 60/84 completed
### Test Failures
<details>
<summary><strong>UserControllerSpec > User list</strong> (:grails-test-examples-scaffolding:integrationTest in <a href="https://github.com/apache/grails-core/actions/runs/32780264043/job/97600561629?pr=16209">CI / Functional Tests (Java 25, indy=false)</a>)</summary>
```
geb.waiting.WaitTimeoutException: condition did not pass in 30 seconds (failed with exception)
at geb.waiting.Wait.waitFor(Wait.groovy:128)
at geb.waiting.DefaultWaitingSupport.doWaitFor(DefaultWaitingSupport.groovy:55)
at geb.waiting.DefaultWaitingSupport.waitFor(DefaultWaitingSupport.groovy:41)
at geb.Page.waitFor(Page.groovy:120)
at com.example.pages.LoginPage.login(LoginPage.groovy:39)
at com.example.UserControllerSpec.User list(UserControllerSpec.groovy:48)
Caused by: Assertion failed:
title != pageTitle && $('input', name: 'username').empty
| | | |
| | | false
| | 'Please sign in'
| false
'Please sign in'
at com.example.pages.LoginPage.login_closure1(LoginPage.groovy:39)
at com.example.pages.LoginPage.login_closure1(LoginPage.groovy)
at geb.waiting.Wait.waitFor(Wait.groovy:117)
... 5 more
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 UserControllerSpec > User list <!-- uniqueId=[engine:spock]/[spec:com.example.UserControllerSpec]/[feature:$spock_feature_1_0] -->
Reuse successful test results:
🔲 ♻️ Only rerun the tests that failed or were muted before
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Leave a raw collection's elements alone rather than binding them into Object [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5390534330
## 🚨 TestLens detected 1 failed test 🚨
Here is what you can do:
1) Inspect the test failures carefully.
2) If you are convinced that some of the tests are flaky, you can mute them below.
3) Finally, trigger a rerun by checking the rerun checkbox.
### Test Summary
#### [CI / Functional Tests \(Java 21, indy\=false, shard 1\)](https://github.com/apache/grails-core/actions/runs/32687098607/job/97314123411?pr=16209) > :grails-test-examples-app1:integrationTest
| Test | Runs | Flakiness |
|---|---|--:|
| AsyncPromiseSpec > stages execute in correct order | ❌ | 0% 🟢 |
🏷️ Commit: 1829d42ffa62459f7d164afe7e60d9e141468084
▶️ Tests: 17317 executed
🟡 Checks: 33/83 completed
### Test Failures
<details>
<summary><strong>AsyncPromiseSpec > stages execute in correct order</strong> (:grails-test-examples-app1:integrationTest in <a href="https://github.com/apache/grails-core/actions/runs/32687098607/job/97314123411?pr=16209">CI / Functional Tests (Java 21, indy=false, shard 1)</a>)</summary>
```
Condition failed with Exception:
response.assertStatus(200)
| |
| org.opentest4j.AssertionFailedError: HTTP Status differs
| at org.apache.grails.testing.http.client.TestHttpResponse.verify(TestHttpResponse.groovy:980)
| at org.apache.grails.testing.http.client.TestHttpResponse.verifyStatus(TestHttpResponse.groovy:840)
| at org.apache.grails.testing.http.client.TestHttpResponse.assertStatus(TestHttpResponse.groovy:174)
| at functionaltests.async.AsyncPromiseSpec.stages execute in correct order(AsyncPromiseSpec.groovy:253)
<org.apache.grails.testing.http.client.TestHttpResponse@4c8594af delegate=inaccessible jsonSlurperConfig=inaccessible xmlSlurperConfig=inaccessible>
at functionaltests.async.AsyncPromiseSpec.stages execute in correct order(AsyncPromiseSpec.groovy:253)
Caused by: org.opentest4j.AssertionFailedError: HTTP Status differs
at org.apache.grails.testing.http.client.TestHttpResponse.verify(TestHttpResponse.groovy:980)
at org.apache.grails.testing.http.client.TestHttpResponse.verifyStatus(TestHttpResponse.groovy:840)
at org.apache.grails.testing.http.client.TestHttpResponse.assertStatus(TestHttpResponse.groovy:174)
... 1 more
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 AsyncPromiseSpec > stages execute in correct order <!-- uniqueId=[engine:spock]/[spec:functionaltests.async.AsyncPromiseSpec]/[feature:$spock_feature_0_13] -->
Reuse successful test results:
🔲 ♻️ Only rerun the tests that failed or were muted before
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#discussion_r3846066536
##########
grails-web-databinding/src/main/groovy/grails/web/databinding/GrailsWebDataBinder.groovy:
##########
@@ -545,7 +545,17 @@ class GrailsWebDataBinder extends SimpleDataBinder {
}
}
if (persistentInstance == null) {
- if (item instanceof Map || item instanceof DataBindingSource) {
+ if (item == null || referencedType.isAssignableFrom(item.getClass())) {
Review Comment:
Sorry I think the cast must be in parentheses.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole merged PR #16209:
URL: https://github.com/apache/grails-core/pull/16209
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole commented on code in PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#discussion_r3845920076
##########
grails-web-databinding/src/main/groovy/grails/web/databinding/GrailsWebDataBinder.groovy:
##########
@@ -545,7 +545,17 @@ class GrailsWebDataBinder extends SimpleDataBinder {
}
}
if (persistentInstance == null) {
- if (item instanceof Map || item instanceof DataBindingSource) {
+ if (item == null || referencedType.isAssignableFrom(item.getClass())) {
Review Comment:
```
BEFORE 548: if (item == null || referencedType.isAssignableFrom(item.getClass())) {
AFTER 548: if (item == null || referencedType.isAssignableFrom((Object) item.getClass())) {
GrailsWebDataBinder.groovy: 548: [Static type checking] -
Cannot find matching method java.lang.Class#isAssignableFrom(java.lang.Object).
1 error
BUILD FAILED
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Leave a raw collection's elements alone rather than binding them into Object [grails-core]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5390266233
## [Codecov](https://app.codecov.io/gh/apache/grails-core/pull/16209?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `0%` with `4 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 54.0066%. Comparing base ([`2ff37a8`](https://app.codecov.io/gh/apache/grails-core/commit/2ff37a87add6575473ec5cbc5e9a0d10a223d57f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`ae38d9b`](https://app.codecov.io/gh/apache/grails-core/commit/ae38d9bc7e10ae6d2dacfd7d1960fac9b0f5514f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16209?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [.../groovy/grails/databinding/SimpleDataBinder.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16209?src=pr&el=tree&filepath=grails-databinding-core%2Fsrc%2Fmain%2Fgroovy%2Fgrails%2Fdatabinding%2FSimpleDataBinder.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFiaW5kaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L2dyYWlscy9kYXRhYmluZGluZy9TaW1wbGVEYXRhQmluZGVyLmdyb292eQ==) | 0.0000% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../grails/web/databinding/GrailsWebDataBinder.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16209?src=pr&el=tree&filepath=grails-web-databinding%2Fsrc%2Fmain%2Fgroovy%2Fgrails%2Fweb%2Fdatabinding%2FGrailsWebDataBinder.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLXdlYi1kYXRhYmluZGluZy9zcmMvbWFpbi9ncm9vdnkvZ3JhaWxzL3dlYi9kYXRhYmluZGluZy9HcmFpbHNXZWJEYXRhQmluZGVyLmdyb292eQ==) | 0.0000% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/grails-core/pull/16209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## 8.0.x #16209 +/- ##
==================================================
- Coverage 54.0157% 54.0066% -0.0091%
+ Complexity 20170 20168 -2
==================================================
Files 2103 2103
Lines 100643 100647 +4
Branches 17822 17822
==================================================
- Hits 54363 54356 -7
- Misses 38522 38531 +9
- Partials 7758 7760 +2
```
| [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16209?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [.../groovy/grails/databinding/SimpleDataBinder.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16209?src=pr&el=tree&filepath=grails-databinding-core%2Fsrc%2Fmain%2Fgroovy%2Fgrails%2Fdatabinding%2FSimpleDataBinder.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWRhdGFiaW5kaW5nLWNvcmUvc3JjL21haW4vZ3Jvb3Z5L2dyYWlscy9kYXRhYmluZGluZy9TaW1wbGVEYXRhQmluZGVyLmdyb292eQ==) | `74.1379% <0.0000%> (-0.3670%)` | :arrow_down: |
| [.../grails/web/databinding/GrailsWebDataBinder.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16209?src=pr&el=tree&filepath=grails-web-databinding%2Fsrc%2Fmain%2Fgroovy%2Fgrails%2Fweb%2Fdatabinding%2FGrailsWebDataBinder.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLXdlYi1kYXRhYmluZGluZy9zcmMvbWFpbi9ncm9vdnkvZ3JhaWxzL3dlYi9kYXRhYmluZGluZy9HcmFpbHNXZWJEYXRhQmluZGVyLmdyb292eQ==) | `30.0855% <0.0000%> (-0.1032%)` | :arrow_down: |
... and [5 files with indirect coverage changes](https://app.codecov.io/gh/apache/grails-core/pull/16209/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Leave a raw collection's elements alone rather than binding them into Object [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5390149527
## 🚨 TestLens detected 4 failed tests 🚨
Here is what you can do:
1) Inspect the test failures carefully.
2) If you are convinced that some of the tests are flaky, you can mute them below.
3) Finally, trigger a rerun by checking the rerun checkbox.
### Test Summary
#### [CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot \(shard 1\)](https://github.com/apache/grails-core/actions/runs/32683166403/job/97303831039?pr=16209) > :grails-data-mongodb-core:test
| Test | Runs | Flakiness |
|---|---|--:|
| MongoTransactionSpec > test a committed transaction persists all writes atomically | ❌ | [5% 🟠](https://github.com/apache/grails-core/issues/16030) |
| MongoTransactionSpec > test a rolled back transaction discards all writes on the server | ❌ | [5% 🟠](https://github.com/apache/grails-core/issues/16030) |
| MongoTransactionSpec > test read-your-writes within an active transaction | ❌ | [5% 🟠](https://github.com/apache/grails-core/issues/16030) |
| MongoTransactionSpec > test writes across multiple collections roll back together | ❌ | [5% 🟠](https://github.com/apache/grails-core/issues/16030) |
🏷️ Commit: ae38d9bc7e10ae6d2dacfd7d1960fac9b0f5514f
▶️ Tests: 25962 executed
🟡 Checks: 29/77 completed
### Test Failures
<details>
<summary><strong>MongoTransactionSpec > test a committed transaction persists all writes atomically</strong> (:grails-data-mongodb-core:test in <a href="https://github.com/apache/grails-core/actions/runs/32683166403/job/97303831039?pr=16209">CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot (shard 1)</a>)</summary>
```
com.mongodb.MongoSocketReadException: Prematurely reached end of stream
at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:184)
at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:1081)
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandResponseBuffers(InternalStreamConnection.java:589)
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:569)
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceiveInternal(InternalStreamConnection.java:496)
at com.mongodb.internal.connection.InternalStreamConnection.lambda$sendAndReceive$1(InternalStreamConnection.java:385)
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:388)
at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:111)
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:757)
at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:60)
at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:207)
at com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:112)
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:82)
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:74)
at com.mongodb.internal.connection.DefaultServer$OperationCountTrackingConnection.command(DefaultServer.java:297)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$executeRetryableWrite$11(SyncOperationHelper.java:285)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$withSourceAndConnection$1(SyncOperationHelper.java:146)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:177)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$withSourceAndConnection$2(SyncOperationHelper.java:142)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:177)
at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:138)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$executeRetryableWrite$12(SyncOperationHelper.java:270)
at com.mongodb.internal.operation.SyncOperationHelper.lambda$decorateWriteWithRetries$13(SyncOperationHelper.java:329)
at com.mongodb.internal.async.function.RetryingSyncSupplier.get(RetryingSyncSupplier.java:67)
at com.mongodb.internal.operation.SyncOperationHelper.executeRetryableWrite(SyncOperationHelper.java:297)
at com.mongodb.internal.operation.BaseFindAndModifyOperation.execute(BaseFindAndModifyOperation.java:81)
at com.mongodb.client.internal.MongoClusterImpl$OperationExecutorImpl.execute(MongoClusterImpl.java:474)
at com.mongodb.client.internal.MongoCollectionImpl.executeFindOneAndUpdate(MongoCollectionImpl.java:787)
at com.mongodb.client.internal.MongoCollectionImpl.findOneAndUpdate(MongoCollectionImpl.java:766)
at org.grails.datastore.mapping.mongo.engine.MongoCodecEntityPersister.generateIdentifier(MongoCodecEntityPersister.groovy:443)
at org.grails.datastore.mapping.mongo.engine.MongoCodecEntityPersister.persistEntity(MongoCodecEntityPersister.groovy:226)
at org.grails.datastore.mapping.mongo.engine.MongoCodecEntityPersister.persistEntity(MongoCodecEntityPersister.groovy:567)
at org.grails.datastore.mapping.engine.EntityPersister.persist(EntityPersister.java:188)
at org.grails.datastore.mapping.core.AbstractSession.persist(AbstractSession.java:609)
at org.grails.datastore.gorm.GormInstanceApi.save_closure5(GormInstanceApi.groovy:213)
at org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:334)
at org.grails.datastore.gorm.AbstractGormApi.execute(AbstractGormApi.groovy:164)
at org.grails.datastore.gorm.GormInstanceApi.save(GormInstanceApi.groovy:206)
at org.grails.datastore.gorm.GormInstanceApi.save(GormInstanceApi.groovy:173)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.save(GormEntity.groovy:110)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.test a committed transaction persists all writes atomically_closure2(MongoTransactionSpec.groovy:73)
at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:103)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:100)
at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:703)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.withTransaction(GormEntity.groovy:1066)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.test a committed transaction persists all writes atomically(MongoTransactionSpec.groovy:71)
```
</details>
<details>
<summary><strong>MongoTransactionSpec > test a rolled back transaction discards all writes on the server</strong> (:grails-data-mongodb-core:test in <a href="https://github.com/apache/grails-core/actions/runs/32683166403/job/97303831039?pr=16209">CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot (shard 1)</a>)</summary>
```
com.mongodb.MongoTimeoutException: Timed out while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:32837, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
at com.mongodb.internal.connection.BaseCluster.logAndThrowTimeoutException(BaseCluster.java:431)
at com.mongodb.internal.connection.BaseCluster.lambda$selectServer$0(BaseCluster.java:166)
at com.mongodb.internal.time.Timeout.lambda$onExistsAndExpired$16(Timeout.java:238)
at com.mongodb.internal.time.Timeout.lambda$run$10(Timeout.java:203)
at com.mongodb.internal.time.TimePoint.checkedCall(TimePoint.java:100)
at com.mongodb.internal.time.Timeout.call(Timeout.java:176)
at com.mongodb.internal.time.Timeout.run(Timeout.java:196)
at com.mongodb.internal.time.Timeout.onExistsAndExpired(Timeout.java:235)
at com.mongodb.internal.time.Timeout.onExpired(Timeout.java:228)
at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:165)
at com.mongodb.internal.connection.SingleServerCluster.selectServer(SingleServerCluster.java:47)
at com.mongodb.internal.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:91)
at com.mongodb.client.internal.ClientSessionBinding.getConnectionSource(ClientSessionBinding.java:109)
at com.mongodb.client.internal.ClientSessionBinding.getWriteConnectionSource(ClientSessionBinding.java:102)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:169)
at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:138)
at com.mongodb.internal.operation.SyncOperationHelper.withConnection(SyncOperationHelper.java:117)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:73)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:48)
at com.mongodb.client.internal.MongoClusterImpl$OperationExecutorImpl.execute(MongoClusterImpl.java:474)
at com.mongodb.client.internal.MongoDatabaseImpl.executeDrop(MongoDatabaseImpl.java:230)
at com.mongodb.client.internal.MongoDatabaseImpl.drop(MongoDatabaseImpl.java:220)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup_closure1(MongoTransactionSpec.groovy:58)
at org.grails.datastore.gorm.GormStaticApi.withNewSession_closure23(GormStaticApi.groovy:767)
at org.grails.datastore.mapping.core.DatastoreUtils.executeWithNewSession(DatastoreUtils.java:371)
at org.grails.datastore.gorm.GormStaticApi.withNewSession(GormStaticApi.groovy:766)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.withNewSession(GormEntity.groovy:1157)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup(MongoTransactionSpec.groovy:57)
```
</details>
<details>
<summary><strong>MongoTransactionSpec > test read-your-writes within an active transaction</strong> (:grails-data-mongodb-core:test in <a href="https://github.com/apache/grails-core/actions/runs/32683166403/job/97303831039?pr=16209">CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot (shard 1)</a>)</summary>
```
com.mongodb.MongoTimeoutException: Timed out while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:32837, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
at com.mongodb.internal.connection.BaseCluster.logAndThrowTimeoutException(BaseCluster.java:431)
at com.mongodb.internal.connection.BaseCluster.lambda$selectServer$0(BaseCluster.java:166)
at com.mongodb.internal.time.Timeout.lambda$onExistsAndExpired$16(Timeout.java:238)
at com.mongodb.internal.time.Timeout.lambda$run$10(Timeout.java:203)
at com.mongodb.internal.time.TimePoint.checkedCall(TimePoint.java:100)
at com.mongodb.internal.time.Timeout.call(Timeout.java:176)
at com.mongodb.internal.time.Timeout.run(Timeout.java:196)
at com.mongodb.internal.time.Timeout.onExistsAndExpired(Timeout.java:235)
at com.mongodb.internal.time.Timeout.onExpired(Timeout.java:228)
at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:165)
at com.mongodb.internal.connection.SingleServerCluster.selectServer(SingleServerCluster.java:47)
at com.mongodb.internal.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:91)
at com.mongodb.client.internal.ClientSessionBinding.getConnectionSource(ClientSessionBinding.java:109)
at com.mongodb.client.internal.ClientSessionBinding.getWriteConnectionSource(ClientSessionBinding.java:102)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:169)
at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:138)
at com.mongodb.internal.operation.SyncOperationHelper.withConnection(SyncOperationHelper.java:117)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:73)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:48)
at com.mongodb.client.internal.MongoClusterImpl$OperationExecutorImpl.execute(MongoClusterImpl.java:474)
at com.mongodb.client.internal.MongoDatabaseImpl.executeDrop(MongoDatabaseImpl.java:230)
at com.mongodb.client.internal.MongoDatabaseImpl.drop(MongoDatabaseImpl.java:220)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup_closure1(MongoTransactionSpec.groovy:58)
at org.grails.datastore.gorm.GormStaticApi.withNewSession_closure23(GormStaticApi.groovy:767)
at org.grails.datastore.mapping.core.DatastoreUtils.executeWithNewSession(DatastoreUtils.java:371)
at org.grails.datastore.gorm.GormStaticApi.withNewSession(GormStaticApi.groovy:766)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.withNewSession(GormEntity.groovy:1157)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup(MongoTransactionSpec.groovy:57)
```
</details>
<details>
<summary><strong>MongoTransactionSpec > test writes across multiple collections roll back together</strong> (:grails-data-mongodb-core:test in <a href="https://github.com/apache/grails-core/actions/runs/32683166403/job/97303831039?pr=16209">CI - Groovy Joint Validation Build / Build Grails with Groovy snapshot (shard 1)</a>)</summary>
```
com.mongodb.MongoTimeoutException: Timed out while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:32837, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
at com.mongodb.internal.connection.BaseCluster.logAndThrowTimeoutException(BaseCluster.java:431)
at com.mongodb.internal.connection.BaseCluster.lambda$selectServer$0(BaseCluster.java:166)
at com.mongodb.internal.time.Timeout.lambda$onExistsAndExpired$16(Timeout.java:238)
at com.mongodb.internal.time.Timeout.lambda$run$10(Timeout.java:203)
at com.mongodb.internal.time.TimePoint.checkedCall(TimePoint.java:100)
at com.mongodb.internal.time.Timeout.call(Timeout.java:176)
at com.mongodb.internal.time.Timeout.run(Timeout.java:196)
at com.mongodb.internal.time.Timeout.onExistsAndExpired(Timeout.java:235)
at com.mongodb.internal.time.Timeout.onExpired(Timeout.java:228)
at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:165)
at com.mongodb.internal.connection.SingleServerCluster.selectServer(SingleServerCluster.java:47)
at com.mongodb.internal.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:91)
at com.mongodb.client.internal.ClientSessionBinding.getConnectionSource(ClientSessionBinding.java:109)
at com.mongodb.client.internal.ClientSessionBinding.getWriteConnectionSource(ClientSessionBinding.java:102)
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:169)
at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:138)
at com.mongodb.internal.operation.SyncOperationHelper.withConnection(SyncOperationHelper.java:117)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:73)
at com.mongodb.internal.operation.DropDatabaseOperation.execute(DropDatabaseOperation.java:48)
at com.mongodb.client.internal.MongoClusterImpl$OperationExecutorImpl.execute(MongoClusterImpl.java:474)
at com.mongodb.client.internal.MongoDatabaseImpl.executeDrop(MongoDatabaseImpl.java:230)
at com.mongodb.client.internal.MongoDatabaseImpl.drop(MongoDatabaseImpl.java:220)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup_closure1(MongoTransactionSpec.groovy:58)
at org.grails.datastore.gorm.GormStaticApi.withNewSession_closure23(GormStaticApi.groovy:767)
at org.grails.datastore.mapping.core.DatastoreUtils.executeWithNewSession(DatastoreUtils.java:371)
at org.grails.datastore.gorm.GormStaticApi.withNewSession(GormStaticApi.groovy:766)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.withNewSession(GormEntity.groovy:1157)
at org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec.setup(MongoTransactionSpec.groovy:57)
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 MongoTransactionSpec > test a committed transaction persists all writes atomically <!-- uniqueId=[engine:spock]/[spec:org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec]/[feature:$spock_feature_1_1] -->
🔲 MongoTransactionSpec > test a rolled back transaction discards all writes on the server <!-- uniqueId=[engine:spock]/[spec:org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec]/[feature:$spock_feature_1_2] -->
🔲 MongoTransactionSpec > test read-your-writes within an active transaction <!-- uniqueId=[engine:spock]/[spec:org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec]/[feature:$spock_feature_1_4] -->
🔲 MongoTransactionSpec > test writes across multiple collections roll back together <!-- uniqueId=[engine:spock]/[spec:org.grails.datastore.gorm.mongo.transactions.MongoTransactionSpec]/[feature:$spock_feature_1_3] -->
Reuse successful test results:
🔲 ♻️ Only rerun the tests that failed or were muted before
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5401241014
> > Exception downstream
> > ```
> > org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for CodecCacheKey{clazz=class java.lang.Object, types=null}.
> > at org.bson.internal.ProvidersCodecRegistry.lambda$get$0(ProvidersCodecRegistry.java:86)
> > at org.bson.internal.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:79)
> > at org.bson.internal.ChildCodecRegistry.get(ChildCodecRegistry.java:68)
> > at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63)
> > at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29)
> > at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63)
> > at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29)
> > ```
>
> Ok, just ignore my comment, sorry for not testing it. Must be a false positive in IntelliJ.
@matrei that wasn't based on your suggestion. I was just adding the more complete stack trace from before the PR
What is going on with IntelliJ? why does it report things that are not issues?
I see these unrelated 3 errors in the same file.
```
Expected '?', found 'grails.databinding.TypedStructuredBindingEditor'
Expected '?', found 'grails.databinding.converters.ValueConverter'
Expected '?', found 'grails.databinding.converters.FormattedValueConverter'
```
Are we wanting to code to IntelliJ complaints even though gradle compiles everything fine?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Binding empties a raw collection in applications that never opted in to deny-by-default [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on PR #16209:
URL: https://github.com/apache/grails-core/pull/16209#issuecomment-5400691350
> Exception downstream
> ```
> org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for CodecCacheKey{clazz=class java.lang.Object, types=null}.
> at org.bson.internal.ProvidersCodecRegistry.lambda$get$0(ProvidersCodecRegistry.java:86)
> at org.bson.internal.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:79)
> at org.bson.internal.ChildCodecRegistry.get(ChildCodecRegistry.java:68)
> at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63)
> at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29)
> at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63)
> at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29)
> ```
Ok, just ignore my comment, sorry for not testing it. Must be a false positive in IntelliJ.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org