Fix backoff interval scheduling for jobs.

This commit is contained in:
Greyson Parrelli
2023-09-18 12:06:42 -04:00
parent bc8eb44a53
commit 8bad476315
6 changed files with 16 additions and 12 deletions

View File

@@ -253,7 +253,7 @@ class JobController {
int nextRunAttempt = job.getRunAttempt() + 1;
byte[] serializedData = job.serialize();
jobStorage.updateJobAfterRetry(job.getId(), false, nextRunAttempt, backoffInterval, serializedData);
jobStorage.updateJobAfterRetry(job.getId(), System.currentTimeMillis(), nextRunAttempt, backoffInterval, serializedData);
jobTracker.onStateChange(job, JobTracker.JobState.PENDING);
List<Constraint> constraints = Stream.of(jobStorage.getConstraintSpecs(job.getId()))

View File

@@ -40,7 +40,7 @@ public interface JobStorage {
void markJobAsRunning(@NonNull String id, long currentTime);
@WorkerThread
void updateJobAfterRetry(@NonNull String id, boolean isRunning, int runAttempt, long nextRunAttemptTime, @Nullable byte[] serializedData);
void updateJobAfterRetry(@NonNull String id, long currentTime, int runAttempt, long nextBackoffInterval, @Nullable byte[] serializedData);
@WorkerThread
void updateAllJobsToBePending();