Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
bde5ed96
Commit
bde5ed96
authored
Sep 17, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch worker errors that may be subclassed on others that lead to incorrect exits
parent
053c41e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
lib/ansible/executor/process/worker.py
+14
-10
No files found.
lib/ansible/executor/process/worker.py
View file @
bde5ed96
...
...
@@ -20,6 +20,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__
=
type
from
six.moves
import
queue
import
multiprocessing
import
os
import
signal
...
...
@@ -27,6 +28,8 @@ import sys
import
time
import
traceback
from
jinja2.exceptions
import
TemplateNotFound
# TODO: not needed if we use the cryptography library with its default RNG
# engine
HAS_ATFORK
=
True
...
...
@@ -127,8 +130,6 @@ class WorkerProcess(multiprocessing.Process):
except
queue
.
Empty
:
pass
except
(
IOError
,
EOFError
,
KeyboardInterrupt
):
break
except
AnsibleConnectionFailure
:
try
:
if
task
:
...
...
@@ -138,15 +139,18 @@ class WorkerProcess(multiprocessing.Process):
# FIXME: most likely an abort, catch those kinds of errors specifically
break
except
Exception
as
e
:
debug
(
"WORKER EXCEPTION:
%
s"
%
e
)
debug
(
"WORKER EXCEPTION:
%
s"
%
traceback
.
format_exc
())
try
:
if
task
:
task_result
=
TaskResult
(
host
,
task
,
dict
(
failed
=
True
,
exception
=
traceback
.
format_exc
(),
stdout
=
''
))
self
.
_rslt_q
.
put
(
task_result
,
block
=
False
)
except
:
# FIXME: most likely an abort, catch those kinds of errors specifically
if
isinstance
(
e
,
(
IOError
,
EOFError
,
KeyboardInterrupt
))
and
not
isinstance
(
e
,
TemplateNotFound
):
break
else
:
try
:
if
task
:
task_result
=
TaskResult
(
host
,
task
,
dict
(
failed
=
True
,
exception
=
traceback
.
format_exc
(),
stdout
=
''
))
self
.
_rslt_q
.
put
(
task_result
,
block
=
False
)
except
:
debug
(
"WORKER EXCEPTION:
%
s"
%
e
)
debug
(
"WORKER EXCEPTION:
%
s"
%
traceback
.
format_exc
())
# FIXME: most likely an abort, catch those kinds of errors specifically
break
debug
(
"WORKER PROCESS EXITING"
)
...
...
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