I found that the messages are received,and handle_message is spawned in spawn_managed_thread(nameko/containers.py),but isn’t executed for some reason,which I tried very hard but failed to figure out.
The following is what I get by adding “print(fn)” in spawn_managed_thread method:
functools.partial(<bound method Consumer.handle_message of <Consumer [LibvirtCIKojiWatcherService.handle_message] at 0x7fa6ec8f6b50>>, {‘mlist’: {‘list_name’: ‘package-announce’}, ‘msg’: {‘archived-at’: ‘https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/J5IAOAVQXTSTN67OMO3L4HSZB4RQP27Y/’, ‘cc’: None, ‘delivered-to’: None, ‘from’: ‘updates@fedoraproject.org’, ‘in-reply-to’: None, ‘message-id’: ‘20201230013913.4130330A5C71@bastion01.iad2.fedoraproject.org’, ‘references’: None, ‘subject’: ‘Fedora 33 Update: golang-github-pborman-uuid-1.2.1-1.fc33’, ‘to’: ‘package-announce@lists.fedoraproject.org’, ‘user-agent’: None, ‘x-mailman-rule-hits’: ‘nonmember-moderation’, ‘x-mailman-rule-misses’: ‘dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3’, ‘x-message-id-hash’: ‘J5IAOAVQXTSTN67OMO3L4HSZB4RQP27Y’}}, <Message object at 0x7fa6ec88f9d0 with details {‘state’: ‘RECEIVED’, ‘content_type’: ‘application/json’, ‘delivery_tag’: 2, ‘body_length’: 828, ‘properties’: {}, ‘delivery_info’: {‘exchange’: ‘zmq.topic’, ‘routing_key’: ‘org.fedoraproject.prod.mailman.receive’}}>)
What are you expecting to happen that is not happening?
It certainly looks like your message is being received. If you replace your print(fn) with a pdb.set_trace(), or put one in LibvirtCIKojiWatcherService.handle_message, you should be able to step through what is actually happening.
If you can provide example code to reproduce that would be helpful too.
What are you expecting to happen that is not happening?
I add one print line at the beginning of LibvirtCIKojiWatcherService.handle_message,
it’s not printed,I also add pdb.set_trace() at the beginning,and the program didn’t stop.
If you can provide example code to reproduce that would be helpful too
The monkey patch gives Eventlet the ability to switch threads when something blocks for I/O. Without it, threads will block. Essentially your service is deadlocked.
Make sure to apply the monkey patch before any imports, otherwise you don’t import the patched versions.
Yes,after adding eventlet.monkey_patch, my problem is solved,thanks for your information and help.
Would you please review my PR[1] when you get some time to spare?Thanks.