Skip to content

Jobs not executing concurrently, with a quartz error #1690

Open
@fishfacemcgee

Description

@fishfacemcgee

Bug description 🐞

When multiple jobs are created simultaneously, only one is executed at a time instead of concurrently. The logs on the API container included this:

2025-01-10T19:48:35.444Z ERROR 1 --- [SchedulerThread] org.quartz.core.ErrorLogger              : An error occurred while scanning for the next triggers to fire.

org.quartz.JobPersistenceException: Couldn't acquire next trigger: Cannot invoke "org.quartz.JobDetail.isConcurrentExecutionDisallowed()" because "job" is null
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2818) ~[quartz-2.5.0.jar:2.5.0]
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.lambda$acquireNextTriggers$13(JobStoreSupport.java:2703) ~[quartz-2.5.0.jar:2.5.0]
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3736) ~[quartz-2.5.0.jar:2.5.0]
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2702) ~[quartz-2.5.0.jar:2.5.0]
	at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:294) ~[quartz-2.5.0.jar:2.5.0]
Caused by: java.lang.NullPointerException: Cannot invoke "org.quartz.JobDetail.isConcurrentExecutionDisallowed()" because "job" is null
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2769) ~[quartz-2.5.0.jar:2.5.0]
	... 4 common frames omitted

Steps to reproduce

Trigger multiple Terrakube workspace jobs in the same Organization. Most of our Terraform repos are mono repos (where each environment has its own workspace) so pushing a commit with common files modified is the easiest.

Expected behavior

Two or more workspaces run concurrently instead of one at a time.

Example repository

No response

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions