orientechnologies / orientechnologies/orientdb

OrientDB Server instance becomes unusable (no connection possible) after trying to execute task scheduled in the past

Open
#10,550 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
5k
Forks
868
Avg merge
15h 6m
Merged PRs (30d)
18

Description

OrientDB Version: 3.2.43+
Java Version: Java 21 (not specific)
OS: Linux (not specific)

Expected behavior

Tasks scheduled in the past

Actual behavior

OrientDB Server instance becomes unusable (no connection possible) after trying to execute task scheduled in the past:

2025-09-10 09:20:00:001 INFO  Backup started FULL_BACKUP [OBackupTask]
2025-09-10 09:20:10:012 SEVER Exception in thread 'OrientDBEmbedded-1' [ScalingThreadPoolExecutor]
java.lang.IllegalArgumentException: Negative delay.
        at java.base/java.util.Timer.schedule(Timer.java:204)
        at com.orientechnologies.orient.core.Orient.scheduleTask(Orient.java:419)
        at com.orientechnologies.orient.core.Orient.scheduleTask(Orient.java:432)
        at com.orientechnologies.agent.services.backup.OBackupTask.schedule(OBackupTask.java:50)
        at com.orientechnologies.agent.services.backup.OBackupTask.onEvent(OBackupTask.java:116)
        at com.orientechnologies.agent.services.backup.strategy.OBackupStrategy.doBackup(OBackupStrategy.java:92)
        at com.orientechnologies.agent.services.backup.OBackupTask.lambda$null$0(OBackupTask.java:58)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)

OrientDB Server fails to start when a task is scheduled in the past with the following exception:

2025-09-10 09:35:32:585 SEVER Error during server execution [OServerMain$1]
java.lang.IllegalArgumentException: Negative delay.
        at java.base/java.util.Timer.schedule(Timer.java:204)
        at com.orientechnologies.orient.core.Orient.scheduleTask(Orient.java:419)
        at com.orientechnologies.orient.core.Orient.scheduleTask(Orient.java:432)
        at com.orientechnologies.agent.services.backup.OBackupTask.schedule(OBackupTask.java:50)
        at com.orientechnologies.agent.services.backup.OBackupTask.<init>(OBackupTask.java:42)
        at com.orientechnologies.agent.services.backup.OBackupService.initTasks(OBackupService.java:45)
        at com.orientechnologies.agent.services.backup.OBackupService.start(OBackupService.java:163)
        at com.orientechnologies.agent.OEnterpriseAgent.lambda$onAfterActivate$1(OEnterpriseAgent.java:317)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
        at com.orientechnologies.agent.OEnterpriseAgent.onAfterActivate(OEnterpriseAgent.java:317)
        at com.orientechnologies.orient.server.OServer.activate(OServer.java:501)
        at com.orientechnologies.orient.server.OServerMain$1.run(OServerMain.java:49)

Workaround

Shutdown OrientDB server and remove OSystem database.

Steps to reproduce

  1. Configure backup schedule
  2. Wait until first execution
  3. Wait until next execution
  4. Restore backup from step 2 on a new instance

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the stack from com.orientechnologies.orient.core.Orient.scheduleTask through OBackupTask.schedule and OBackupService.initTasks. Reproduce the backup and restore sequence with a past schedule, then verify that the server remains usable and can start without the Negative delay exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.