Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-transfer-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-transfer-service
Commits
65975bb2
Commit
65975bb2
authored
Aug 18, 2021
by
Cristiano Urban
Browse files
Options
Downloads
Patches
Plain Diff
Added job phase check (ABORTED) + minor changes.
Signed-off-by:
Cristiano Urban
<
cristiano.urban@inaf.it
>
parent
4f7bc47f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
transfer_service/retrieve_preprocessor.py
+22
-12
22 additions, 12 deletions
transfer_service/retrieve_preprocessor.py
with
22 additions
and
12 deletions
transfer_service/retrieve_preprocessor.py
+
22
−
12
View file @
65975bb2
...
...
@@ -53,7 +53,7 @@ class RetrievePreprocessor(TaskExecutor):
self
.
nodeList
.
append
(
target
+
'
/
'
+
el
[
"
value
"
])
self
.
jobObj
.
jobInfo
[
"
nodeList
"
]
=
self
.
nodeList
.
copy
()
def
update
(
self
):
def
update
(
self
,
status
):
# Send e-mail notification
m
=
Mailer
(
self
.
logger
)
...
...
@@ -64,20 +64,19 @@ class RetrievePreprocessor(TaskExecutor):
msg
=
f
"""
Dear user,
your job has been
QUEUED
.
your job has been
{
status
}
.
Job ID:
{
self
.
jobObj
.
jobId
}
Job type:
{
self
.
jobObj
.
type
}
Owner ID:
{
self
.
jobObj
.
ownerId
}
You will be notified by email once the job is completed.
"""
m
.
setMessage
(
"
VOSpace data retrieve notification: Job
QUEUED
"
,
msg
)
m
.
setMessage
(
f
"
VOSpace data retrieve notification: Job
{
status
}
"
,
msg
)
m
.
send
()
def
cleanup
(
self
):
self
.
nodeList
.
clear
()
self
.
setDestinationQueueName
(
"
read_ready
"
)
def
run
(
self
):
self
.
logger
.
info
(
"
Starting retrieve preprocessor...
"
)
...
...
@@ -89,12 +88,23 @@ class RetrievePreprocessor(TaskExecutor):
srcQueueLen
=
self
.
srcQueue
.
len
()
destQueueLen
=
self
.
destQueue
.
len
()
except
:
self
.
logger
.
exception
(
"
Cache error:
fai
le
d
to retrieve queue length.
"
)
self
.
logger
.
exception
(
"
Cache error:
unab
le to retrieve queue length.
"
)
else
:
if
destQueueLen
<
self
.
maxReadyJobs
and
srcQueueLen
>
0
:
self
.
jobObj
=
self
.
srcQueue
.
getJob
()
jobId
=
self
.
jobObj
.
jobId
self
.
execute
()
self
.
update
()
try
:
jobPhase
=
self
.
dbConn
.
getPhase
(
jobId
)
except
Exception
:
self
.
logger
.
exception
(
f
"
Database error: unable to retrieve job phase for job
{
jobId
}
.
"
)
else
:
if
jobPhase
==
"
ABORTED
"
:
self
.
jobObj
.
setPhase
(
"
ABORTED
"
)
self
.
setDestinationQueueName
(
"
read_terminated
"
)
self
.
update
(
"
ABORTED
"
)
else
:
self
.
update
(
"
QUEUED
"
)
try
:
self
.
destQueue
.
insertJob
(
self
.
jobObj
)
self
.
srcQueue
.
extractJob
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment