Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit 7040821

Browse files
authored
Merge pull request #65 from CDLUC3/requeue-special
requeue special
2 parents 3400399 + a04a8ac commit 7040821

File tree

8 files changed

+64
-9
lines changed

8 files changed

+64
-9
lines changed

mysql-ruby-lambda/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ DEPENDENCIES
4848
uc3-ssm!
4949

5050
BUNDLED WITH
51-
2.6.4
51+
2.6.5

src-admintool/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ GEM
1010
specs:
1111
ast (2.4.2)
1212
aws-eventstream (1.3.1)
13-
aws-partitions (1.1052.0)
13+
aws-partitions (1.1053.0)
1414
aws-sdk-core (3.219.0)
1515
aws-eventstream (~> 1, >= 1.3.0)
1616
aws-partitions (~> 1, >= 1.992.0)
@@ -69,4 +69,4 @@ DEPENDENCIES
6969
uc3-ssm!
7070

7171
BUNDLED WITH
72-
2.6.4
72+
2.6.5

src-colladmin/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GEM
1919
specs:
2020
ast (2.4.2)
2121
aws-eventstream (1.3.1)
22-
aws-partitions (1.1052.0)
22+
aws-partitions (1.1053.0)
2323
aws-sdk-core (3.219.0)
2424
aws-eventstream (~> 1, >= 1.3.0)
2525
aws-partitions (~> 1, >= 1.992.0)
@@ -58,7 +58,7 @@ GEM
5858
mime-types (3.6.0)
5959
logger
6060
mime-types-data (~> 3.2015)
61-
mime-types-data (3.2025.0204)
61+
mime-types-data (3.2025.0220)
6262
mini_portile2 (2.8.8)
6363
mysql2 (0.5.6)
6464
netrc (0.11.0)
@@ -121,4 +121,4 @@ DEPENDENCIES
121121
zookeeper
122122

123123
BUNDLED WITH
124-
2.6.4
124+
2.6.5

src-colladmin/actions/zookeeper_action.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,42 @@ def perform_action
328328
end
329329
end
330330

331+
## Queue manipulation action using new mrt-zk - special handling to skip downloading
332+
class ZkRequeueSpecialAction < ZkAction
333+
def perform_action
334+
if @qpath =~ /access/
335+
acc = MerrittZK::Access.new(get_access_queue, get_id)
336+
acc.load(@zk)
337+
acc.set_status(@zk, MerrittZK::AccessState::Pending)
338+
{ message: "Acc #{acc.id} requeued " }.to_json
339+
else
340+
job = MerrittZK::Job.new(get_id)
341+
job.load(@zk)
342+
js = job.json_property(@zk, MerrittZK::ZkKeys::STATUS)
343+
laststat = js.fetch(:last_successful_status, '')
344+
345+
job.lock(@zk)
346+
347+
case laststat
348+
when 'Pending', '', nil
349+
job.set_status(@zk, MerrittZK::JobState::Estimating, job_retry: true)
350+
when 'Estimating'
351+
job.set_status(@zk, MerrittZK::JobState::Provisioning, job_retry: true)
352+
when 'Provisioning' || 'Downloading'
353+
job.set_status(@zk, MerrittZK::JobState::Processing, job_retry: true)
354+
when 'Processing'
355+
job.set_status(@zk, MerrittZK::JobState::Recording, job_retry: true)
356+
when 'Recording'
357+
job.set_status(@zk, MerrittZK::JobState::Notify, job_retry: true)
358+
end
359+
360+
job.unlock(@zk)
361+
362+
{ message: "Job #{job.id} requeued to status #{job.status_name}" }.to_json
363+
end
364+
end
365+
end
366+
331367
## Queue manipulation action using new mrt-zk
332368
class ZkDeleteAction < ZkAction
333369
def perform_action

src-colladmin/config/actions.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ queues:
104104
description: |
105105
Display the contents of the *ingest queue*. Items in this queue are slated to be processed by the Ingest service.
106106
From this screen, items can be requeued.
107+
108+
- *Requeue* will return a job to the state AFTER last successful state for a job.
109+
- *Requeue Special* will set a job to a specific state if available.
110+
- If the last successful state is 'Provisioning', the job will be reset to 'Processing'.
111+
- Otherwise, this button will perform the same action as the *Requeue* button.
107112
report-datatypes:
108113
- fprofile
109114
- fstatus
@@ -987,6 +992,18 @@ requeue-mrtzk:
987992
- requeue
988993
documentation: |
989994
ZK tbd
995+
requeue-special-mrtzk:
996+
link-title: Re-queue an item from a Zookeeper queue
997+
class: ZkRequeueSpecialAction
998+
category: Queue Management
999+
sensitivity: irreversible change
1000+
testing: manual
1001+
description: |
1002+
Re-queue an item from a Zookeeper queue.
1003+
report-datatypes:
1004+
- requeue
1005+
documentation: |
1006+
ZK tbd
9901007
hold-queue-item-mrtzk:
9911008
link-title: Move a pending item from in Zookeeper queue to a Held status
9921009
class: ZkHoldAction

src-common/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ DEPENDENCIES
6161
uc3-ssm!
6262

6363
BUNDLED WITH
64-
2.6.4
64+
2.6.5

src-common/template/api-table.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,8 @@ function format(cell, v, type, merritt_path) {
794794
} else if (type == 'requeue-mrtzk' && v != '') {
795795
p = colladmin_root + "/lambda?path=requeue-mrtzk&queue-path="+v;
796796
makeLink(cell, 'Requeue', "javascript:ajax_invoke('"+encodeURIComponent(p)+"');testRequeue()").addClass("ajax");
797+
p = colladmin_root + "/lambda?path=requeue-special-mrtzk&queue-path="+v;
798+
makeLink(cell, 'Requeue Special', "javascript:ajax_invoke('"+encodeURIComponent(p)+"');testRequeue()").addClass("ajax");
797799
} else if (type == 'hold' && v != '') {
798800
p = colladmin_root + "/lambda?path=hold-queue-item&queue-path="+v;
799801
makeLink(cell, 'Hold', "javascript:ajax_invoke('"+encodeURIComponent(p)+"')").addClass("ajax");

src-testdriver/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ GEM
1010
specs:
1111
ast (2.4.2)
1212
aws-eventstream (1.3.1)
13-
aws-partitions (1.1052.0)
13+
aws-partitions (1.1053.0)
1414
aws-sdk-core (3.219.0)
1515
aws-eventstream (~> 1, >= 1.3.0)
1616
aws-partitions (~> 1, >= 1.992.0)
@@ -91,4 +91,4 @@ DEPENDENCIES
9191
uc3-ssm!
9292

9393
BUNDLED WITH
94-
2.6.4
94+
2.6.5

0 commit comments

Comments
 (0)