Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-rest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-rest
Commits
b3c09a07
Commit
b3c09a07
authored
3 years ago
by
Nicola Fulvio Calabria
Browse files
Options
Downloads
Patches
Plain Diff
unlock nodes in case of copyNode failure after file service call
parent
7184b385
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/it/inaf/oats/vospace/JobService.java
+13
-0
13 additions, 0 deletions
src/main/java/it/inaf/oats/vospace/JobService.java
with
13 additions
and
0 deletions
src/main/java/it/inaf/oats/vospace/JobService.java
+
13
−
0
View file @
b3c09a07
...
...
@@ -18,6 +18,7 @@ import it.inaf.oats.vospace.exception.InvalidArgumentException;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
it.inaf.oats.vospace.exception.VoSpaceErrorSummarizableException
;
import
it.inaf.oats.vospace.persistence.NodeDAO
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.concurrent.CompletableFuture
;
...
...
@@ -52,6 +53,9 @@ public class JobService {
@Autowired
private
FileServiceClient
fileServiceClient
;
@Autowired
private
NodeDAO
nodeDao
;
public
enum
JobDirection
{
pullToVoSpace
,
...
...
@@ -193,10 +197,19 @@ public class JobService {
User
user
=
(
User
)
servletRequest
.
getUserPrincipal
();
CompletableFuture
.
runAsync
(()
->
{
handleJobErrors
(
jobSummary
,
job
->
{
String
jobId
=
jobSummary
.
getJobId
();
// Index 0: source 1: destination
List
<
String
>
sourceAndDestination
=
copyService
.
processCopyNodes
(
transfer
,
jobId
,
user
);
// Call file service and command copy
try
{
fileServiceClient
.
startFileCopyJob
(
sourceAndDestination
.
get
(
0
),
sourceAndDestination
.
get
(
1
),
jobId
,
user
);
}
catch
(
Exception
e
)
{
// We decided not to purge metadata in case of failure
// just release busy nodes setting job_id = null
nodeDao
.
releaseBusyNodesByJobId
(
jobId
);
throw
e
;
}
return
null
;
});
...
...
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
register
or
sign in
to comment