Skip to content
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

CADC-12563 allow the AbstractExecutor to run a sync job in the SUSPENDED phase #59

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cadc-uws-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sourceCompatibility = 1.8

group = 'org.opencadc'

version = '1.2.19'
version = '1.2.20'

description = 'OpenCADC UWS server library'
def git_url = 'https://github.com/opencadc/uws'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,20 @@ public final void execute(Job job, SyncOutput sync)
log.debug("execute: " + job.getID() + " sync=" + (sync != null));
log.debug(job.getID() + ": PENDING -> QUEUED");
ExecutionPhase ep = jobUpdater.setPhase(job.getID(), ExecutionPhase.PENDING, ExecutionPhase.QUEUED);
if (!ExecutionPhase.QUEUED.equals(ep))
{
ExecutionPhase actual = jobUpdater.getPhase(job.getID());
log.debug(job.getID() + ": PENDING -> QUEUED [FAILED] -- was " + actual);
throw new JobPhaseException("cannot execute job " + job.getID() + " when phase = " + actual);

// If the phase change from PENDING to QUEUED fails (null ExecutionPhase returned from setPhase()),
// check for a sync job in the SUSPENDED phase, if found do not change the phase, and allow the job to be run.
if (ep == null && sync != null && job.getExecutionPhase().equals(ExecutionPhase.SUSPENDED)) {
log.debug(job.getID() + ": SUSPENDED - no phase change");
} else {
if (!ExecutionPhase.QUEUED.equals(ep)) {
ExecutionPhase actual = jobUpdater.getPhase(job.getID());
log.debug(job.getID() + ": PENDING -> QUEUED [FAILED] -- was " + actual);
throw new JobPhaseException("cannot execute job " + job.getID() + " when phase = " + actual);
}
job.setExecutionPhase(ep);
log.debug(job.getID() + ": PENDING -> QUEUED [OK]");
}
job.setExecutionPhase(ep);
log.debug(job.getID() + ": PENDING -> QUEUED [OK]");

try
{
Expand Down
Loading