
This change patches zmq GarbageCollector to use zmq.Context() from eventlet.green instead of default zmq.Context(). It was identified that sysinv-agent process was hanged. It was blocked on zmq garbage collector recv() call. Replacing the Garbage Collector to use the green Context solves the issue. Test Plan: PASS: Build package with build-pkgs -p pyzmq PASS: Build ISO PASS: Install on lab, configure ACC100, backup system PASS: Reinstall and restore system, then host-unlock Closes-Bug: 2060867 Change-Id: I229a8a4c70ebb4d7056fa2ff60bfc910bf12b257 Signed-off-by: Alyson Deives Pereira <alyson.deivespereira@windriver.com>
54 lines
1.7 KiB
Diff
54 lines
1.7 KiB
Diff
From b24e217033d40fd675f1a386e566665b8439266e Mon Sep 17 00:00:00 2001
|
|
From: Alyson Deives Pereira <alyson.deivespereira@windriver.com>
|
|
Date: Wed, 10 Apr 2024 15:06:46 -0300
|
|
Subject: [PATCH] Use green zmq.Context from eventlet if it has been
|
|
monkey-patched
|
|
|
|
Make GarbageCollector aware of eventlet and verify it the Thread module
|
|
has been monkey-patched by eventlet. If that is the case, use zmq
|
|
.Context() from eventlet.green module.
|
|
|
|
Signed-off-by: Alyson Deives Pereira <alyson.deivespereira@windriver.com>
|
|
---
|
|
docs/requirements.txt | 1 +
|
|
zmq/utils/garbage.py | 6 +++++-
|
|
2 files changed, 6 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/docs/requirements.txt b/docs/requirements.txt
|
|
index dfc9278..e30cd02 100644
|
|
--- a/docs/requirements.txt
|
|
+++ b/docs/requirements.txt
|
|
@@ -1,4 +1,5 @@
|
|
cython>=0.29
|
|
+eventlet
|
|
gevent
|
|
pygments==2.4.2
|
|
sphinx>=3.0.4
|
|
diff --git a/zmq/utils/garbage.py b/zmq/utils/garbage.py
|
|
index d96bbd9..bb6b1ce 100644
|
|
--- a/zmq/utils/garbage.py
|
|
+++ b/zmq/utils/garbage.py
|
|
@@ -11,7 +11,7 @@ import struct
|
|
|
|
from os import getpid
|
|
from collections import namedtuple
|
|
-from threading import Thread, Event, Lock
|
|
+from threading import Thread, Event, Lock, current_thread
|
|
import warnings
|
|
|
|
import zmq
|
|
@@ -95,6 +95,10 @@ class GarbageCollector(object):
|
|
# gevent has monkey-patched Thread, use green Context
|
|
from zmq import green
|
|
self._context = green.Context()
|
|
+ elif current_thread.__module__.startswith('eventlet'):
|
|
+ # eventlet has monkey-patched Thread, use green Context
|
|
+ from eventlet.green import zmq
|
|
+ self._context = zmq.Context()
|
|
else:
|
|
self._context = zmq.Context()
|
|
return self._context
|
|
--
|
|
2.34.1
|
|
|