Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
Mirror
cc-node
Commits
b4d3d8a9
Commit
b4d3d8a9
authored
12 years ago
by
Anael Beutot
Browse files
Options
Downloads
Patches
Plain Diff
Fix error reporting for ForkedJob (parent error)
parent
a4c1c017
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cloudcontrol/node/jobs.py
+10
-4
10 additions, 4 deletions
cloudcontrol/node/jobs.py
with
10 additions
and
4 deletions
cloudcontrol/node/jobs.py
+
10
−
4
View file @
b4d3d8a9
...
...
@@ -8,6 +8,7 @@ import sys
from
threading
import
Thread
,
Event
from
cloudcontrol.node.exc
import
JobError
from
cloudcontrol.node.utils
import
num_to_sig
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -240,8 +241,9 @@ class ForkedJob(object):
for
fd
in
self
.
open_fds
:
try
:
os
.
close
(
fd
)
except
OSError
:
logger
.
error
(
'
Error while closing fds in parent
'
)
except
OSError
as
exc
:
logger
.
error
(
'
Error while closing fds in parent: %s
'
,
os
.
strerror
(
exc
.
errno
))
raise
def
start
(
self
):
...
...
@@ -281,8 +283,12 @@ class ForkedJob(object):
break
assert
pid
==
self
.
fork_pid
if
return_status
>>
8
!=
0
:
raise
JobError
(
'
Exception during job, returned %s
'
,
return_status
)
if
return_status
&
0xff
==
signal
.
SIGKILL
:
logger
.
error
(
'
Job was killed
'
)
else
:
raise
JobError
(
'
Exception during job, returned %s, signal %s
'
,
return_status
,
num_to_sig
(
return_status
&
0xff
))
finally
:
self
.
fork_pid
=
None
self
.
job_done
.
set
()
...
...
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