)]}'
{"specs/liberty/zeromq-socket-reuse.rst":[{"author":{"_account_id":13290,"name":"Oleksii Zamiatin","email":"ozamiatin@mirantis.com","username":"ozamiatin"},"change_message_id":"6fd0b5cc17e9bb84b22d3a118cd67a20e160ac63","unresolved":false,"context_lines":[{"line_number":39,"context_line":"the sockets are in use, it should wait until an in-use socket changes"},{"line_number":40,"context_line":"its state to available."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"In order to identify the status of the socket in runtime, here we"},{"line_number":43,"context_line":"introduce MessageTracker[1] provided by pyzmq library. For each"},{"line_number":44,"context_line":"outbound socket, we create a tracker object to trace its status."},{"line_number":45,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"bab921fb_b446a4bd","line":42,"updated":"2015-04-23 11:06:32.000000000","message":"As I understand the MessageTracker is needed here to track whether message is sent already to release the socket back to the pool. Such approach breaks zmq optimizations like collecting messages to send them in one bigger bunch. I suppose the performance degrade has been occurred first of all because of that. The proper way is to release the socket right after we called send. It doesn\u0027t break the PUSH and PUB \"send and forget\" logic.","commit_id":"b15b5888d4ed0946cdc22a704baaa6572dfe6831"},{"author":{"_account_id":13290,"name":"Oleksii Zamiatin","email":"ozamiatin@mirantis.com","username":"ozamiatin"},"change_message_id":"a1debeabf605d36edb43c7813a319d211ed751f5","unresolved":false,"context_lines":[{"line_number":39,"context_line":"the sockets are in use, it should wait until an in-use socket changes"},{"line_number":40,"context_line":"its state to available."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"In order to identify the status of the socket in runtime, here we"},{"line_number":43,"context_line":"introduce MessageTracker[1] provided by pyzmq library. For each"},{"line_number":44,"context_line":"outbound socket, we create a tracker object to trace its status."},{"line_number":45,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"bab921fb_c3b363e8","line":42,"in_reply_to":"bab921fb_7c043cbf","updated":"2015-04-24 11:12:19.000000000","message":"Instability may be caused by sharing the socket between multiple threads which is strongly prohibited by zmq docs. This situation is most likely happens with eventlet coding style and shared structure like pool. To make the pool stable and thread-safe we need to consider a single thread responsible to perform all sockets operations. This is all my assumptions so I don\u0027t insist if you have a workable solution with MessageTracker.","commit_id":"b15b5888d4ed0946cdc22a704baaa6572dfe6831"},{"author":{"_account_id":13290,"name":"Oleksii Zamiatin","email":"ozamiatin@mirantis.com","username":"ozamiatin"},"change_message_id":"282de6bfecd8ca70b49888f1c532e6c1e4b6c971","unresolved":false,"context_lines":[{"line_number":39,"context_line":"the sockets are in use, it should wait until an in-use socket changes"},{"line_number":40,"context_line":"its state to available."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"In order to identify the status of the socket in runtime, here we"},{"line_number":43,"context_line":"introduce MessageTracker[1] provided by pyzmq library. For each"},{"line_number":44,"context_line":"outbound socket, we create a tracker object to trace its status."},{"line_number":45,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3acd31a7_b972c247","line":42,"in_reply_to":"bab921fb_ab67cfe7","updated":"2015-05-04 16:02:16.000000000","message":"\u003e Currently, socket is created per message.\n\nYes, now we have no sharing problem. It appears with reuse mechanism.\n\nHere\u0027s what the guide says: http://api.zeromq.org/2-1:zmq\n\nActually it doesn\u0027t prohibit to pass the socket object, to another thread, but we have to be sure that all operations come from a single thread and no concurrent access to the socket take place.\n\n\u003e do you have plan to split eventlet?\n\nYes, in my implementation I don\u0027t use the eventlet directly. In current impl we have green zmq, it has to work well with eventlet. I need some more time to investigate this.","commit_id":"b15b5888d4ed0946cdc22a704baaa6572dfe6831"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"5801eb07b1e4f1c5280cabf7e18e270bcd5822d8","unresolved":false,"context_lines":[{"line_number":39,"context_line":"the sockets are in use, it should wait until an in-use socket changes"},{"line_number":40,"context_line":"its state to available."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"In order to identify the status of the socket in runtime, here we"},{"line_number":43,"context_line":"introduce MessageTracker[1] provided by pyzmq library. For each"},{"line_number":44,"context_line":"outbound socket, we create a tracker object to trace its status."},{"line_number":45,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"bab921fb_7c043cbf","line":42,"in_reply_to":"bab921fb_b446a4bd","updated":"2015-04-24 09:14:13.000000000","message":"Yes, MessageTracker determines when to recycle sockets. Actually the \u0027proper\u0027 way makes zeromq unstable.\n\nIn bug report [1], the driver causes fd leak. It is also discovered in our production system.\n\nIn bug report [2], cast timeout is not respected.\n\n[1] https://bugs.launchpad.net/oslo.messaging/+bug/1193439\n[2] https://bugs.launchpad.net/oslo.messaging/+bug/1097927\n\nThis blueprint also fixes these bugs. IMO, \u0027send and forget\u0027 brings uncertainty. In order to make it a stable rpc driver, I don\u0027t think highly of the current implementation. By the way, the performance degradation is acceptable considering that zeromq driver brings a broker-less architecture to scale out.","commit_id":"b15b5888d4ed0946cdc22a704baaa6572dfe6831"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"86bc1bb66f937d24c968211dab55a93790b73b8f","unresolved":false,"context_lines":[{"line_number":39,"context_line":"the sockets are in use, it should wait until an in-use socket changes"},{"line_number":40,"context_line":"its state to available."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"In order to identify the status of the socket in runtime, here we"},{"line_number":43,"context_line":"introduce MessageTracker[1] provided by pyzmq library. For each"},{"line_number":44,"context_line":"outbound socket, we create a tracker object to trace its status."},{"line_number":45,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"bab921fb_ab67cfe7","line":42,"in_reply_to":"bab921fb_c3b363e8","updated":"2015-04-26 11:21:15.000000000","message":"Good points.\n\nCurrently, socket is created per message. It seems not possible to share it between multiple threads.\n\nCould you provide the reference to discuss about socket sharing?\n\nBy the way, do you have plan to split eventlet? I think it has something to do with my implementation.","commit_id":"b15b5888d4ed0946cdc22a704baaa6572dfe6831"}]}
