-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Job not fired again after connection to database was lost #1254
Comments
Hi, thanks for feedback. Is there anything you see in the logs? Stack traces? |
No, I turned on DEBUG loglevel, there are no errors/stacktraces, just the debug message |
Does it happen just after the start of the app or after several executions of the job? |
It only happens when connection to database is temporarily unavailable during a job run. No matter how often the job was already executed. |
From the code it can't happen 🙂 Would you be willing to help me to debug it? I can release a new version with more logging and it may give us some hints. |
I'd like to help you debug it 👍 |
Hi, I have just release version 4.43.0 with more logging, can you please try? Thank you |
Hi, thanks for the new version. I tried it out, but I'm afraid the output won't help you much (Shedlock lock time is 1m, Scheduler runs every min):
|
Can you please check what's in the ShedLock DB table (lock_until)? |
Sorry for the late response... Log file entry: DB entry Update: |
Ok, the one hour difference is an interesting clue (unless it's a coincidence). Do you have |
I can add some more detail here. The issue occurs if the database connection is lost just before a job finishes and want to unlock through: ShedLock/shedlock-core/src/main/java/net/javacrumbs/shedlock/core/DefaultLockingTaskExecutor.java Line 75 in 884eacf
After this I am seeing the same log outputs mentioned above. Everything is fine if the database connection is lost before/after executing the job. I hope this helps - let me know if I can add more information to understand the issue. My setup: Gradle implementation('net.javacrumbs.shedlock:shedlock-spring:5.13.0')
implementation('net.javacrumbs.shedlock:shedlock-provider-jdbc-template:5.13.0') My config: @Bean
public LockProvider lockProvider(final DataSource dataSource) {
final JdbcTemplateLockProvider.Configuration configuration = JdbcTemplateLockProvider.Configuration.builder()
.withTableName("my_lock")
.withJdbcTemplate(new JdbcTemplate(dataSource))
.usingDbTime()
.build();
return new JdbcTemplateLockProvider(configuration);
} |
Version: 4.42.0
Provider: JdbcTemplateLockProvider
Config: @EnableSchedulerLock(defaultLockAtMostFor = "10m", defaultLockAtLeastFor = "10m")
When connection to database is lost during a job run (and then re-established), it will not be triggered again, although the lock_until is in the past. ("n.j.s.core.DefaultLockingTaskExecutor Not executing 'xxxx'. It's locked.")
After a restart (Spring Boot) it is triggered again as expected.
The text was updated successfully, but these errors were encountered: