Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
788fe756
Commit
788fe756
authored
Nov 03, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run DeleteSlice in the background so it returns to the caller
much quicker.
parent
3522a680
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
protogeni/lib/GeniAM.pm.in
protogeni/lib/GeniAM.pm.in
+10
-0
protogeni/lib/GeniCMV2.pm.in
protogeni/lib/GeniCMV2.pm.in
+14
-5
No files found.
protogeni/lib/GeniAM.pm.in
View file @
788fe756
...
...
@@ -417,6 +417,11 @@ sub DeleteSliver()
'
credentials
' => $credentials
};
my $response = GeniCMV2::DeleteSlice($delete_args);
if (!ref($response)) {
# This is cause GeniCMV2::DeleteSlice does a fork, and the child
# returns plain status code, which should go to our caller.
return $response;
}
if (GeniResponse::IsError($response)) {
return $response;
} else {
...
...
@@ -1210,6 +1215,11 @@ sub Delete
'credentials'
=>
$
credentials
};
my
$
response
=
GeniCMV2
::
DeleteSlice
($
args
);
if
(
!ref($response)) {
#
This
is
cause
GeniCMV2
::
DeleteSlice
does
a
fork
,
and
the
child
#
returns
plain
status
code
,
which
should
go
to
our
caller
.
return
$
response
;
}
if
(
! GeniResponse::IsError($response)) {
$
response
=
GeniResponse
->
Create
(
GENIRESPONSE_SUCCESS
,
$
slivers
);
}
...
...
protogeni/lib/GeniCMV2.pm.in
View file @
788fe756
...
...
@@ -740,13 +740,22 @@ sub DeleteSlice($)
$
slice
->
UnLock
();
return
GeniResponse
->
BusyResponse
();
}
#
#
Proceed
in
the
background
.
No
reason
to
make
the
caller
wait
,
#
it
takes
too
long
.
#
my
$
mypid
=
main
::
WrapperFork
();
if
($
mypid
)
{
return
GeniResponse
->
Create
(
GENIRESPONSE_SUCCESS
);
}
if
(
GeniCM
::
CleanupDeadSlice
($
slice
,
1
)
!= 0) {
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
undef
,
"Could not cleanup slice"
);
#
#
We
may
need
to
send
email
here
.
#
return
-
1
;
}
done
:
return
GeniResponse
->
Create
(
GENIRESPONSE_SUCCESS
);
return
0
;
}
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment