Skip to content

BAEL-8820: DB-Scheduler - Persistent cluster-friendly scheduler for Java - #19295

Merged
theangrydev merged 4 commits into
eugenp:masterfrom
sazzer:BAEL-8820
Aug 14, 2026
Merged

BAEL-8820: DB-Scheduler - Persistent cluster-friendly scheduler for Java#19295
theangrydev merged 4 commits into
eugenp:masterfrom
sazzer:BAEL-8820

Conversation

@sazzer

@sazzer sazzer commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +1 to +15
create table scheduled_tasks (
task_name varchar(100),
task_instance varchar(100),
task_data blob,
execution_time TIMESTAMP WITH TIME ZONE,
picked BIT,
picked_by varchar(50),
last_success TIMESTAMP WITH TIME ZONE,
last_failure TIMESTAMP WITH TIME ZONE,
consecutive_failures INT,
last_heartbeat TIMESTAMP WITH TIME ZONE,
version BIGINT,
priority SMALLINT,
PRIMARY KEY (task_name, task_instance)
) No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's fix the formatting here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was directly copied from the db-scheduler files, formatting and all. I can update it if you want though?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes please, we should follow the Baeldung formatting style for PRs

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DbSchedulerLiveTest {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

JUnit 5 test classes are package-private per the repo conventions, so let's drop the public

Comment on lines +101 to +102
// Just block forever
Thread.currentThread().join();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These join() tests block forever here, so they never complete or assert anything, even when run deliberately. Let's use a CountDownLatch (or Awaitility) in the execute handler, await with a timeout, assert the task actually ran, then scheduler.stop(). Same for the one-time and dynamic recurring tests below.

}

@Test
void whenStartingARecurringTask_theTaskRunsRegularly() throws Exception {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
void whenStartingARecurringTask_theTaskRunsRegularly() throws Exception {
void whenStartingARecurringTask_thenTheTaskRunsRegularly() throws Exception {

whenXxx_thenXxxx

Same below

@theangrydev
theangrydev merged commit b7693b4 into eugenp:master Aug 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants