Skip to content

Merge 9.0.x into 9.1.x - #17142

Merged
codeconsole merged 27 commits into
apache:9.1.xfrom
codeconsole:merge/9.0.x-into-9.1.x
Nov 22, 2026
Merged

codeconsole merged 27 commits into
apache:9.1.xfrom
codeconsole:merge/9.0.x-into-9.1.x

Conversation

@codeconsole

Copy link
Copy Markdown
Contributor

Merges 9.0.x into 9.1.x, which brings #17085 from 7.0.x, and from 8.0.x: #17092 and #17093 (close the sessions of an asynchronous request when it completes, Hibernate 5 and 7), #16968 (ACL domain classes generated by s2-create-acl-domains), #16972 (the sec tags render nothing when the plugin is inactive), #16981 (one-line MongoDB index failure log), #17049 (subqueries in updateAll and deleteAll), and the conflict resolution of 8.0.x's own merge of 7.2.x (95b69f3), which adapts the 8.0.x-only BuildIndexesFailureSummarySpec to #16981, and from 8.1.x: #16963 (Windows environment names in the config index) to this line.

No conflicts. The merge changes only files those commits change, plus that spec. No dependency version, Gradle version or .sdkmanrc changes; the build-script changes are the versionless compileOnly servlet API for the two OSIV interceptors, the inactive security test config in gradle.yml, and a trailing newline.

This branch is built on #17141 (8.1.x into 9.0.x), so merge that one first.

codeconsole and others added 27 commits November 19, 2026 18:01
…binds to the transaction

With synchronization active and no session bound, DatastoreUtils.getSession
binds the session it opens and registers a synchronization that unbinds and
closes it when the transaction completes. The interceptor skipped its own
bind but did not record that it joined that session, so it closed it when
the request completed, and the synchronization then failed to unbind it.
Record it as joined, as for a session bound before the request.
…t completes

The open session in view interceptor closed the sessions it opened as soon
as a request went asynchronous. A task that the action returned then failed
to lazily load an association of an entity the action had loaded: with a
LazyInitializationException, or with a NullPointerException from Hibernate
when it got there while the session was being closed.

The sessions are still taken off the thread when the request goes
asynchronous, so that the thread's next request does not use them. They are
now closed when the asynchronous request completes, from an AsyncListener on
the request's asynchronous context, which the container also calls after a
timeout or an error. Without an asynchronous context, they are closed at
once, as before.
…t completes

The open session in view interceptor closed the sessions it opened as soon
as a request went asynchronous. A task that the action returned then failed
to lazily load an association of an entity the action had loaded: with a
LazyInitializationException, or with a NullPointerException from Hibernate
when it got there while the session was being closed.

The sessions are still taken off the thread when the request goes
asynchronous, so that the thread's next request does not use them. They are
now closed when the asynchronous request completes, from an AsyncListener on
the request's asynchronous context, which the container also calls after a
timeout or an error. Without an asynchronous context, they are closed at
once, as before.
…re a timeout

For a Callable or DeferredResult, Spring starts the asynchronous request
before the open session in view interceptor runs, so the sessions of the
other datasources are closed when the request completes there too. A new
MultiDataSourceSessionSpec feature covers that path. The timeout feature
of OsivRequestSessionSpec now checks that the sessions stay open while
the request waits, so that it fails without the change.

The class Javadoc of GrailsOpenSessionInViewInterceptor says when the
sessions are closed, and the features that run without an asynchronous
context say so.
…re a timeout

For a Callable or DeferredResult, Spring starts the asynchronous request
before the open session in view interceptor runs, so the sessions of the
other datasources are closed when the request completes there too. A new
MultiDataSourceSessionSpec feature covers that path. The timeout feature
of OsivRequestSessionSpec now checks that the sessions stay open while
the request waits, so that it fails without the change.

The class Javadoc of GrailsOpenSessionInViewInterceptor says when the
sessions are closed, and the features that run without an asynchronous
context say so.
… not return leaves open

On 7.0.x, a task that an action starts and does not return makes the
request asynchronous without marking it as started by Grails. The open
session in view interceptor then leaves the default session to Spring,
which takes it off the thread and closes it in the dispatch that a
Callable or DeferredResult starts. When the task completes the request
itself, there is no such dispatch, and the session stayed open.

The interceptor now also closes that session when the asynchronous
request completes, unless it is closed by then. A new
OsivRequestSessionSpec feature has such a task complete the request,
and the Spring feature of MultiDataSourceSessionSpec now expects both
sessions closed when the request completes without a dispatch. Both
fail without the change.
…sync-request-completes-7.0.x

fix(hibernate5): close the sessions of an asynchronous request when it completes
…sync-request-completes-8.0.x

fix(hibernate7): close the sessions of an asynchronous request when it completes
…ters in order, joins its criteria with AND and has no WHERE without criteria (apache#17049)

JpaQueryBuilder wrote the subquery of an inList or notIn criterion into the bulk statements of updateAll and deleteAll
without advancing the parameter position past the parameters it added, so a criterion after it failed with
"Could not locate named parameter [p3], expecting one of [p1, p2]". It also wrote the criteria of a subquery one after
the other with no AND between them, and wrote WHERE for a subquery that has no criteria, which is not valid.

The position continues from the number of parameters after a subquery, in the In handler and in handleSubQuery, and
the criteria of a subquery are joined as a conjunction, with no WHERE when there are none.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…ace at debug (apache#16981)

MongoDatastore.initializeIndices logged a MongoCommandException from
createIndex at ERROR together with the exception, so a server error such
as 86 IndexKeySpecsConflict printed a huge stack trace at every startup
for a condition the operator must fix in the mapping or the database.

The ERROR event now carries only the entity, the index definition and the
server message; the stack trace goes to a separate DEBUG event. This
covers the single, compound and property index paths.

The module's tests ran on slf4j-nop, which cannot capture log events, so
logback-classic (managed by the BOM) replaces it as the single SLF4J
binding for the tests, and a new spec provokes a real index conflict
against a MongoDB container and asserts on the captured events.

Fixes apache#15667

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…active (apache#16972)

* fix(spring-security): render nothing from sec tags when the plugin is inactive

With grails.plugin.springsecurity.active = false the plugin defines none of
its beans, so a GSP using <sec:ifAllGranted> failed with "No bean named
'roleHierarchy' available". Every tag of SecurityTagLib now renders nothing
when the property is false; it still defaults to true.

Covered by SecurityTagLibInactiveSpec (all 13 tags) and, in the core
functional-test-app, by the new 'inactive' TESTCONFIG and
InactiveSecurityTagLibSpec.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL

* chore: trigger CI

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL

* [run tests] chore: run the tests

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…s compare and serialize as the plugin's (apache#16968)

The templates of AclClass, AclSid, AclEntry and AclObjectIdentity had no @EqualsAndHashCode and did not implement
Serializable, unlike the plugin's own domain classes. A generated copy compared by identity, and a generated
AclObjectIdentity compared equal to another with a different objectId, because the equality of its base class ignores
objectId. The ACL services look ACLs up by that equality, so an object whose ACL exists failed with a NotFoundException.

The templates now declare the same equality and serialVersionUID as the domain classes. GeneratedAclDomainsSpec renders each
template, compiles it and checks equality, hashCode and Serializable. The script does not overwrite an existing class, so
the documentation of s2-create-acl-domains says what to add to a copy generated earlier.

Fixes apache#15927

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…stinct in the index (apache#16963)

The index of the process environment used String.CASE_INSENSITIVE_ORDER on Windows, which also lower-cases and so
reads CONFIG_ID and CONFIG_İD (U+0130) as one name: copying both dropped one value, and a lookup could return the
wrong override or miss a variable. It now compares names as the JVM does there, each character upper-cased.

A test can index an environment as Windows holds it on any machine, through refreshSystemEnvironment(env, windows).

Fixes apache#16765

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…-synchronization-7.0.x

fix(datastore-web): leave a session that transaction synchronization binds to the transaction
@testlens-app

testlens-app Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

🚨 All tests passed but jobs failed 🚨

Failed Jobs without Test Failures

❌ Code Analysis / Gradle Plugin Projects

🏷️ Commit: e7a41ec
▶️ Tests: 11398 executed
⚪️ Checks: 100/100 completed

Rerun Controls

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app/docs.

@codeconsole
codeconsole merged commit c901309 into apache:9.1.x Nov 22, 2026
26 of 95 checks passed
@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.2040%. Comparing base (bdce36c) to head (e7a41ec).
⚠️ Report is 28 commits behind head on 9.1.x.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##                9.1.x     #17142         +/-   ##
===================================================
- Coverage     65.6548%   49.2040%   -16.4508%     
+ Complexity      33033       1053      -31980     
===================================================
  Files            2446         94       -2352     
  Lines          121420       5339     -116081     
  Branches        22528        955      -21573     
===================================================
- Hits            79718       2627      -77091     
+ Misses          31635       2377      -29258     
+ Partials        10067        335       -9732     

see 2352 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants