openstack社区上看到一个bug,和我目前遇到的问题一样:
https://review.openstack.org/...
但是文中的解释有些不理解:
- threading 和 eventlet executor是什么,为什么会有这两种机制
- 下面这两句话不太理解(不是英文不理解),希望高手能解答一下,不胜感激!
With eventlet, we don't really share the socket between threads.
But with threading executor and expecialy ssl, this can't work, if you
write data with two different threads to the socket.
总结问题:我对这个问题的理解是:使用eventlet机制是没有问题的,这个问题是由于使用了threading造成的。多个线程使用同一个socket去处理消息会造成混乱,就像多个线程同时打印信息到屏幕上在一行里就会出现信息错乱的情况一样。