Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
workflow
pypushflow
Commits
6e9d6766
Commit
6e9d6766
authored
Jul 31, 2020
by
payno
Browse files
Using a pool with no daemon process
parent
7cc4f442
Changes
2
Hide whitespace changes
Inline
Side-by-side
pypushflow/PythonActor.py
View file @
6e9d6766
...
...
@@ -28,12 +28,13 @@ import pprint
import
logging
import
traceback
import
functools
import
multiprocessing.pool
import
multiprocessing
from
multiprocessing.pool
import
Pool
as
_Pool
from
pypushflow.AbstractActor
import
AbstractActor
from
pypushflow.representation.scheme.node
import
Node
logger
=
logging
.
getLogger
(
'pypushflow'
)
logger
=
logging
.
getLogger
(
__name__
)
class
WorkflowException
(
Exception
):
...
...
@@ -81,7 +82,7 @@ class NoDaemonProcess(multiprocessing.Process):
# because the latter is only a wrapper function, not a proper class.
class
Edna2Pool
(
multiprocessing
.
pool
.
Pool
):
class
Pool
(
_
Pool
):
Process
=
NoDaemonProcess
#
...
...
@@ -115,9 +116,7 @@ class AsyncFactory:
self
.
node
=
node
self
.
callback
=
callback
self
.
errorCallback
=
errorCallback
# self.pool = Edna2Pool(1)
self
.
pool
=
multiprocessing
.
Pool
(
1
)
# TODO: this shouldn't be limited to 1
self
.
pool
=
Pool
(
1
)
def
call
(
self
,
*
args
,
**
kwargs
):
logger
.
debug
(
'Before apply_async, func={0}, callback={1}, errorCallback={2}'
.
format
(
...
...
@@ -273,6 +272,7 @@ class PythonActor(AbstractActor):
'errorMessage'
:
workflowException
.
errorMessage
,
'traceBack'
:
workflowException
.
traceBack
.
split
(
'
\n
'
),
}
logger
.
warning
(
'oldInData type: {}, value: {}'
.
format
(
type
(
oldInData
),
oldInData
))
oldInData
[
'WorkflowException'
]
=
exceptionDict
for
errorHandler
in
self
.
list_error_handler
:
errorHandler
.
trigger
((
None
,
oldInData
))
...
...
representation
@
4513c7e7
Compare
e99104e1
...
4513c7e7
Subproject commit
e99104e134c9932d2be81c3870f5c923ba62cccc
Subproject commit
4513c7e79561e6e687badce4f98fb9dd8a26ac04
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment