Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flamenco-worker-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
blender
flamenco-worker-python
Commits
ad505ee8
Commit
ad505ee8
authored
8 years ago
by
Sybren A. Stüvel
Browse files
Options
Downloads
Patches
Plain Diff
Worker: patching asyncio to avoid an occasional crash
Thanks to David Keeney for helping out with this.
parent
f4092726
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/flamenco-worker-python/flamenco_worker/cli.py
+4
-0
4 additions, 0 deletions
packages/flamenco-worker-python/flamenco_worker/cli.py
packages/flamenco-worker-python/flamenco_worker/patch_asyncio.py
+29
-0
29 additions, 0 deletions
...s/flamenco-worker-python/flamenco_worker/patch_asyncio.py
with
33 additions
and
0 deletions
packages/flamenco-worker-python/flamenco_worker/cli.py
+
4
−
0
View file @
ad505ee8
...
@@ -24,6 +24,10 @@ def main():
...
@@ -24,6 +24,10 @@ def main():
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
log
.
debug
(
'
Starting
'
)
log
.
debug
(
'
Starting
'
)
# Patch AsyncIO
from
.
import
patch_asyncio
patch_asyncio
.
patch_asyncio
()
# Construct the AsyncIO loop
# Construct the AsyncIO loop
loop
=
construct_asyncio_loop
()
loop
=
construct_asyncio_loop
()
if
args
.
verbose
:
if
args
.
verbose
:
...
...
This diff is collapsed.
Click to expand it.
packages/flamenco-worker-python/flamenco_worker/patch_asyncio.py
0 → 100644
+
29
−
0
View file @
ad505ee8
"""
Patches a safer version of resume_reading into the asyncio.unix_events._UnixReadPipeTransport class.
This prevents an error at the end of a subprocess execution:
File
"
/usr/lib/python3.x/asyncio/unix_events.py
"
, line 364, in resume_reading
self._loop.add_reader(self._fileno, self._read_ready)
AttributeError:
'
NoneType
'
object has no attribute
'
add_reader
'
"""
import
asyncio.unix_events
as
ue
def
patch_asyncio
():
import
logging
log
=
logging
.
getLogger
(
__name__
)
log
.
debug
(
'
Patching ue._UnixReadPipeTransport.resume_reading
'
)
orig_resume_reading
=
ue
.
_UnixReadPipeTransport
.
resume_reading
def
resume_reading
(
self
,
*
args
,
**
kwargs
):
if
not
self
.
_loop
:
return
return
orig_resume_reading
(
*
args
,
**
kwargs
)
ue
.
_UnixReadPipeTransport
.
resume_reading
=
resume_reading
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