Skip to content

Import grails-quartz - #16185

Merged
jdaugherty merged 666 commits into
apache:7.0.xfrom
jdaugherty:importQuartz
Aug 22, 2026
Merged

jdaugherty merged 666 commits into
apache:7.0.xfrom
jdaugherty:importQuartz

Conversation

@jdaugherty

Copy link
Copy Markdown
Contributor

Per vote [1], this merges grails-quartz into grails-core. I also have fixed some vulnerabilities as part of this merge since I had to scan the repo to merge.

  1. https://lists.apache.org/thread/6781tod7s48kscdbcmd3yr4m18t10kg2

jeffscottbrown and others added 30 commits November 10, 2015 04:17
Made QuartzJob trait GrailsApplicationAware
# Conflicts:
#	build.gradle
…sabled, extra check on SessionBinderListener that jdbcStore is turned on.
SchedulerFactoryBean and AdaptableJobFactory come from spring-context-support,
which the plugin creates unconditionally, but it was not declared. It is also
not reliably inherited from the rest of the stack -- grails-gsp excludes it from
its transitive graph -- so an application depending only on this plugin failed
to start with a NoClassDefFoundError.
Documents Spring's @scheduled support and its lack of cluster awareness,
introduces Quartz as the clustered alternative, and covers Quartz clustering
requirements and pitfalls in full.
Restructures the guide so Background Jobs is the entry point, with Basic
Scheduling (Spring @scheduled) as the recommended default and Clustered
Scheduling (Quartz) presented as the answer to problems Spring's scheduler
cannot solve -- principally multi-instance deployments.
Clustering is one capability of the Quartz plugin, not what adding it gives you.
Renames the section accordingly and states explicitly, in the chapter intro and
on the section landing page, that Quartz defaults to an in-memory job store and
must be configured before it is cluster-safe.
@jdaugherty

Copy link
Copy Markdown
Contributor Author

The commits appear to be here now so this should be ready to review once tests pass.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

FYI: Given that we voted already to merge this, I intend to merge by Sunday so it can be in the latest 7.x releases. @matrei @jamesfredley please let me know if you disagree with this approach.

@sbglasius sbglasius left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know cleaning up was not part of the merge, but QuartzGrailsPlugin property access could really use some love.

boolean hasHibernate = hasHibernate(manager)
def hasJdbcStore = properties['org.quartz.jdbcStore']?.toBoolean()
if (hasJdbcStore == null) {
hasJdbcStore = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jdbcStore fallbacks default to true when unset (?.toBoolean() yields null, then the guard assigns true) in doWithSpring, configureScheduler and scheduleJob, contradicting the documented default of false.
An app that overrides the quartz config block without a jdbcStore key (so plugin.yml's false is not in effect) gets a JDBC job store wired to the dataSource and transactionManager beans, and startup fails against a database with no QRTZ_* tables.

}

void onChange(Map<String, Object> event) {
def pluginEnabled = properties['org.quartz.pluginEnabled']?.toBoolean()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing loading properties?

Properties properties = loadQuartzProperties()

Comment on lines +75 to +78
def pluginEnabled = properties['org.quartz.pluginEnabled']?.toBoolean()
if (pluginEnabled == null) {
pluginEnabled = true
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used several places, perhaps a method

boolean getPluginEnabled() {
	grailsApplication.config.getProperty('quartz.pluginEnabled', Boolean, true)
}

Comment on lines +70 to +73
def hasJdbcStore = properties['org.quartz.jdbcStore']?.toBoolean()
if (hasJdbcStore == null) {
hasJdbcStore = true
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use properties.getProperty('org.quartz.jdbcStor', true).toBoolean() for default value

@jdaugherty

Copy link
Copy Markdown
Contributor Author

@sbglasius based on your feedback, I addressed the plugin descriptor & other issues. To be consistent, and because we've previously voted on listing author/developers, I've gone ahead and cleaned up a wider set of plugins to be consistent across all of the ones in grails-core

@testlens-app

testlens-app Bot commented Aug 22, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 5758fc0
▶️ Tests: 49450 executed
⚪️ Checks: 57/57 completed


Learn more about TestLens at testlens.app/docs.

@jdaugherty
jdaugherty merged commit 612cc0d into apache:7.0.x Aug 22, 2026
58 checks passed
@jdaugherty
jdaugherty deleted the importQuartz branch August 22, 2026 18:52
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.