)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11255,"name":"Dustin Lundquist","username":"dustin.lundquist","inactive":true},"change_message_id":"58dd697dbd0773398abc50a50436855da23087ab","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Carlos D. Garza \u003ccarlos.garza@rackspace.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-07-14 20:19:15 -0500"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implement udp heartbeat sender and receiver"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Used binary compressed encoding of json dumped object. to reduce"},{"line_number":10,"context_line":"the size needed to send heart beats incase some stats objects"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a41bdd9_e6bdd302","line":7,"updated":"2015-07-15 16:24:00.000000000","message":"nit: s/udp/UDP/","commit_id":"526880c8eae945df33ad1c382fd3ebf9f71a7fb9"},{"author":{"_account_id":11255,"name":"Dustin Lundquist","username":"dustin.lundquist","inactive":true},"change_message_id":"58dd697dbd0773398abc50a50436855da23087ab","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implement udp heartbeat sender and receiver"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Used binary compressed encoding of json dumped object. to reduce"},{"line_number":10,"context_line":"the size needed to send heart beats incase some stats objects"},{"line_number":11,"context_line":"start getting sent later on. Also used sha256 instead of sha1"},{"line_number":12,"context_line":"with hmac."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a41bdd9_e654f3ca","line":9,"updated":"2015-07-15 16:24:00.000000000","message":"nit: To reduce.","commit_id":"526880c8eae945df33ad1c382fd3ebf9f71a7fb9"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"0ac30c2b19f49036148492f25254c50887ffc3bb","unresolved":false,"context_lines":[{"line_number":11,"context_line":"start getting sent later on. Also used sha256 instead of sha1"},{"line_number":12,"context_line":"with hmac."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Co-Authored-By: Michael Johnson \u003cjohnsomor@gmail.com\u003e"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I932c693101b94c9132e1741291610508876eab43"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"1a4dcd0f_492e0b44","line":14,"updated":"2015-08-12 23:34:17.000000000","message":"Carlos make sure to add yourself to Co-Authored-By otherwise you won\u0027t get ATC credit","commit_id":"109120d4e4d368fbf74ce6918c46eee01b23e895"}],"elements/amphora-agent/source-repository-amphora-agent":[{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"0ac30c2b19f49036148492f25254c50887ffc3bb","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# This is temporary until we have a pip package"},{"line_number":2,"context_line":"amphora-agent git /opt/amphora-agent https://review.openstack.org/openstack/octavia refs/changes/82/201882/24"},{"line_number":3,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":27,"id":"1a4dcd0f_8918931f","line":2,"updated":"2015-08-12 23:34:17.000000000","message":"please exclude that from the patch... since eventually it will be merged :-)","commit_id":"109120d4e4d368fbf74ce6918c46eee01b23e895"}],"octavia/amphorae/backends/agent/api_server/util.py":[{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"a1c1f8fa5e588a3b2b8c942b2556f342ec541898","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def pid_path(listener_id):"},{"line_number":34,"context_line":"    return os.path.join(haproxy_dir(listener_id), listener_id + \u0027.pid\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def config_path(listener_id):"}],"source_content_type":"text/x-python","patch_set":29,"id":"1a4dcd0f_d58f972c","line":34,"updated":"2015-08-15 00:16:15.000000000","message":"Why does this need to be changed?  It is unique via the directory path with the listener_id in it.","commit_id":"f08b10f1f76f6818b0df2540ce9fd7145c6164b2"}],"octavia/amphorae/backends/health_daemon/health_daemon.py":[{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"938d3f1771268e79c77721522f55cc3ca48e44b5","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    seq \u003d 0"},{"line_number":31,"context_line":"    while True:"},{"line_number":32,"context_line":"        if sighup_received:"},{"line_number":33,"context_line":"            print(\u0027re-reading config file\u0027)"},{"line_number":34,"context_line":"            sighup_received \u003d False"},{"line_number":35,"context_line":"            cfg.check_update()"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_478128fa","line":33,"updated":"2015-07-22 22:08:32.000000000","message":"should log it.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"525d0529dcdae90e864c409c927fe08b43d6ac58","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    seq \u003d 0"},{"line_number":31,"context_line":"    while True:"},{"line_number":32,"context_line":"        if sighup_received:"},{"line_number":33,"context_line":"            print(\u0027re-reading config file\u0027)"},{"line_number":34,"context_line":"            sighup_received \u003d False"},{"line_number":35,"context_line":"            cfg.check_update()"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_7af14e00","line":33,"in_reply_to":"3a50d1a3_478128fa","updated":"2015-07-29 04:28:38.000000000","message":"Wasn\u0027t my code but sure I\u0027ll log it.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"185ac98bcad0cf1ff74b337d73b1f08dc6ce1977","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT"},{"line_number":13,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":14,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import argparse"},{"line_number":18,"context_line":"import signal"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_a579c484","line":15,"updated":"2015-07-30 00:29:50.000000000","message":"This file should be removed and the run sender be made part of the amphora agent","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT"},{"line_number":13,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":14,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import argparse"},{"line_number":18,"context_line":"import signal"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_ec754ccc","line":15,"in_reply_to":"3a50d1a3_a579c484","updated":"2015-07-30 19:21:15.000000000","message":"where is this agent at? as part of the rest agent?","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"69f0ed10663ac128dcf3f6130a55393b096f4526","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT"},{"line_number":13,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":14,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import argparse"},{"line_number":18,"context_line":"import signal"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_55e64017","line":15,"in_reply_to":"3a50d1a3_ec754ccc","updated":"2015-07-30 19:56:58.000000000","message":"I call the REST agent often amphora agent - so should be part of the REST amphora agent","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"d2014d549a3ab046688cb6585be331b95082f248","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def sighup_handler(signum, frame):"},{"line_number":27,"context_line":"    cfg.check_update()"},{"line_number":28,"context_line":"    print(\"sighup received re-reading config file\")"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def run_sender():"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_d69b6465","line":28,"updated":"2015-07-30 02:00:58.000000000","message":"should log.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"51119abdd956e9af1f6c7da317f4b24e41074a1e","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def sighup_handler(signum, frame):"},{"line_number":27,"context_line":"    cfg.check_update()"},{"line_number":28,"context_line":"    print(\"sighup received re-reading config file\")"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def run_sender():"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_a81082ac","line":28,"in_reply_to":"3a50d1a3_d69b6465","updated":"2015-07-31 03:38:23.000000000","message":"suprisingly this never survives to the log.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"185ac98bcad0cf1ff74b337d73b1f08dc6ce1977","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    seq \u003d 0"},{"line_number":37,"context_line":"    while True:"},{"line_number":38,"context_line":"        message \u003d {\u0027id\u0027: cfg[\u0027id\u0027],"},{"line_number":39,"context_line":"                   \u0027seq\u0027: seq}"},{"line_number":40,"context_line":"        seq +\u003d 1"},{"line_number":41,"context_line":"        sender.dosend(message)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_25bcd405","line":38,"updated":"2015-07-30 00:29:50.000000000","message":"This message just indicates if the amphora is up. Use the harpy stats socket library I wrote to access the harpy stats and get more info if harpy is actually up; also send those stats as part of the message for later stats gathering","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"69f0ed10663ac128dcf3f6130a55393b096f4526","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    seq \u003d 0"},{"line_number":37,"context_line":"    while True:"},{"line_number":38,"context_line":"        message \u003d {\u0027id\u0027: cfg[\u0027id\u0027],"},{"line_number":39,"context_line":"                   \u0027seq\u0027: seq}"},{"line_number":40,"context_line":"        seq +\u003d 1"},{"line_number":41,"context_line":"        sender.dosend(message)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_b5b784f4","line":38,"in_reply_to":"3a50d1a3_0c8518ac","updated":"2015-07-30 19:56:58.000000000","message":"yes, we should makes sure haproxy is running. Stats socket is a good way to check","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    seq \u003d 0"},{"line_number":37,"context_line":"    while True:"},{"line_number":38,"context_line":"        message \u003d {\u0027id\u0027: cfg[\u0027id\u0027],"},{"line_number":39,"context_line":"                   \u0027seq\u0027: seq}"},{"line_number":40,"context_line":"        seq +\u003d 1"},{"line_number":41,"context_line":"        sender.dosend(message)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_0c8518ac","line":38,"in_reply_to":"3a50d1a3_25bcd405","updated":"2015-07-30 19:21:15.000000000","message":"i\u0027m thinking by harpy you mean haproxy bc of autocorrect?","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"51119abdd956e9af1f6c7da317f4b24e41074a1e","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    seq \u003d 0"},{"line_number":37,"context_line":"    while True:"},{"line_number":38,"context_line":"        message \u003d {\u0027id\u0027: cfg[\u0027id\u0027],"},{"line_number":39,"context_line":"                   \u0027seq\u0027: seq}"},{"line_number":40,"context_line":"        seq +\u003d 1"},{"line_number":41,"context_line":"        sender.dosend(message)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_c87ceeed","line":38,"in_reply_to":"3a50d1a3_b5b784f4","updated":"2015-07-31 03:38:23.000000000","message":"this was how the code was when I got to it but I guess.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":11255,"name":"Dustin Lundquist","username":"dustin.lundquist","inactive":true},"change_message_id":"2f1f59f4308893662c5325414358db7e930f6229","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def sighup_handler(signum, frame):"},{"line_number":27,"context_line":"    cfg.check_update()"},{"line_number":28,"context_line":"    print(\"sighup received re-reading config file\")"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3a50d1a3_9e07c7c8","line":27,"updated":"2015-08-01 04:01:55.000000000","message":"Is cfg is scope here? and is check_update() safe to call from within a signal handler? Generally there are very few guarantees as to the state of a running program when a signal handler is run.","commit_id":"63a38625ea07719494b937519699aaa644967251"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"0ac30c2b19f49036148492f25254c50887ffc3bb","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def get_amp_id():"},{"line_number":41,"context_line":"    m \u003d amp_id_re.match(socket.gethostname())"},{"line_number":42,"context_line":"    if m:"},{"line_number":43,"context_line":"        return m.group(1)"},{"line_number":44,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_691747a3","line":41,"updated":"2015-08-12 23:34:17.000000000","message":"I would prefer to get that out of a configuration file rather than the hostname -- if we use config drive to launch an instance we can embed that into the file being shipped over. I also believe there is  a way to get to the instance or compete id somehow from within the vm...","commit_id":"109120d4e4d368fbf74ce6918c46eee01b23e895"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"f19568bac9f6dccd3faf8f21faf1eb294f661ca8","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def get_amp_id():"},{"line_number":41,"context_line":"    m \u003d amp_id_re.match(socket.gethostname())"},{"line_number":42,"context_line":"    if m:"},{"line_number":43,"context_line":"        return m.group(1)"},{"line_number":44,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_c19d0f67","line":41,"in_reply_to":"1a4dcd0f_691747a3","updated":"2015-08-13 02:37:50.000000000","message":"originally I was extracting it from\n/etc/amphora/status_sender.json but in our current set up nothing is creating that JSON file so I\u0027ve been copying it over by hand. I\u0027ll talk to johnsom how to do this. He seemed to imply he was using a framework to inject the /etc/amphora directory. Reverting the code to fetch the amp id from the status_sender.json file.","commit_id":"109120d4e4d368fbf74ce6918c46eee01b23e895"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"0ac30c2b19f49036148492f25254c50887ffc3bb","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            msg[\u0027listeners\u0027][listener_id] \u003d listener_dict"},{"line_number":123,"context_line":"            if util.is_listener_running(listener_id):"},{"line_number":124,"context_line":"                th \u003d GetStatusThread(listener_id, stat_sock_file)"},{"line_number":125,"context_line":"                threads.append(th)"},{"line_number":126,"context_line":"                th.start()"},{"line_number":127,"context_line":"                threads.append(th)"},{"line_number":128,"context_line":"        for th in threads:"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_cfd0db21","line":125,"updated":"2015-08-12 23:34:17.000000000","message":"might be a bit overkill to query each stats socket continually in it\u0027s own thread - my thought the send could query the sockets, close, compile the packet and send","commit_id":"109120d4e4d368fbf74ce6918c46eee01b23e895"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"f19568bac9f6dccd3faf8f21faf1eb294f661ca8","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            msg[\u0027listeners\u0027][listener_id] \u003d listener_dict"},{"line_number":123,"context_line":"            if util.is_listener_running(listener_id):"},{"line_number":124,"context_line":"                th \u003d GetStatusThread(listener_id, stat_sock_file)"},{"line_number":125,"context_line":"                threads.append(th)"},{"line_number":126,"context_line":"                th.start()"},{"line_number":127,"context_line":"                threads.append(th)"},{"line_number":128,"context_line":"        for th in threads:"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_e1a60baa","line":125,"in_reply_to":"1a4dcd0f_cfd0db21","updated":"2015-08-13 02:37:50.000000000","message":"These were quick dying (via join ) threads that didn\u0027t run continually. But I got rid of them anyways.","commit_id":"109120d4e4d368fbf74ce6918c46eee01b23e895"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"0ac30c2b19f49036148492f25254c50887ffc3bb","unresolved":false,"context_lines":[{"line_number":165,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":166,"context_line":"    args \u003d parse_args()"},{"line_number":167,"context_line":"    try:"},{"line_number":168,"context_line":"        config.JSONFileConfig().set_filename(args[\u0027config\u0027])"},{"line_number":169,"context_line":"    except IOError as exc:"},{"line_number":170,"context_line":"        LOG.exception(exc)"},{"line_number":171,"context_line":"        sys.exit(1)"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_6fa667c2","line":168,"updated":"2015-08-12 23:34:17.000000000","message":"we migth want to switch to the real configuration file/oslo format","commit_id":"109120d4e4d368fbf74ce6918c46eee01b23e895"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"f19568bac9f6dccd3faf8f21faf1eb294f661ca8","unresolved":false,"context_lines":[{"line_number":165,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"},{"line_number":166,"context_line":"    args \u003d parse_args()"},{"line_number":167,"context_line":"    try:"},{"line_number":168,"context_line":"        config.JSONFileConfig().set_filename(args[\u0027config\u0027])"},{"line_number":169,"context_line":"    except IOError as exc:"},{"line_number":170,"context_line":"        LOG.exception(exc)"},{"line_number":171,"context_line":"        sys.exit(1)"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_613c3be1","line":168,"in_reply_to":"1a4dcd0f_6fa667c2","updated":"2015-08-13 02:37:50.000000000","message":"I\u0027ll ask Johnsom about this.","commit_id":"109120d4e4d368fbf74ce6918c46eee01b23e895"}],"octavia/amphorae/backends/health_daemon/health_sender.py":[{"author":{"_account_id":11255,"name":"Dustin Lundquist","username":"dustin.lundquist","inactive":true},"change_message_id":"63e67229db47184c30381958efbef044ef9dc713","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            # e.g. 4 \u003d sockaddr - what we actually need"},{"line_number":49,"context_line":"            for addr in addrlist:"},{"line_number":50,"context_line":"                self.dests.append(addr)  # Just grab the first match"},{"line_number":51,"context_line":"                break"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def dosend(self, obj):"},{"line_number":54,"context_line":"        envelope_str \u003d status_message.wrap_envelope(obj, self.key)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a41bdd9_3ebdc002","line":51,"updated":"2015-07-16 16:40:31.000000000","message":"This method is called update, but it appends on address to the list of dests. And doesn\u0027t allow removing addresses. This seems like an append method rather than an update method.\n\nAdditionally, it would be more pythonic to use next(addrlist) rather than for ... break.","commit_id":"1ff77e5869187da48e111cc1cb9a4743b101988d"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"d2014d549a3ab046688cb6585be331b95082f248","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import status_message"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def round_robbin_addr(addrinfo_list):"},{"line_number":25,"context_line":"    addrinfo \u003d addrinfo_list.pop(0)"},{"line_number":26,"context_line":"    addrinfo_list.append(addrinfo)"},{"line_number":27,"context_line":"    return addrinfo"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_103474f9","line":24,"updated":"2015-07-30 02:00:58.000000000","message":"should handle an empty addrinfo_list?","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import status_message"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def round_robbin_addr(addrinfo_list):"},{"line_number":25,"context_line":"    addrinfo \u003d addrinfo_list.pop(0)"},{"line_number":26,"context_line":"    addrinfo_list.append(addrinfo)"},{"line_number":27,"context_line":"    return addrinfo"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_4c47a077","line":24,"in_reply_to":"3a50d1a3_103474f9","updated":"2015-07-30 19:21:15.000000000","message":"s/robbin/robin","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"}],"octavia/amphorae/backends/health_daemon/status_message.py":[{"author":{"_account_id":11255,"name":"Dustin Lundquist","username":"dustin.lundquist","inactive":true},"change_message_id":"58dd697dbd0773398abc50a50436855da23087ab","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# If any one finds a better way let me know. I tried hex() but it kept"},{"line_number":30,"context_line":"# slapping 0x in front of every character or woulden\u0027t accept a bin array"},{"line_number":31,"context_line":"hex_chars \u003d \"0123456789abcdef\""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_26d5fbe6","line":30,"updated":"2015-07-15 16:24:00.000000000","message":"If this is just used for the error message, I don\u0027t see any problem with using hex().","commit_id":"526880c8eae945df33ad1c382fd3ebf9f71a7fb9"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"3c1263eba5896c696eaed040e647950ec2075be8","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# If any one finds a better way let me know. I tried hex() but it kept"},{"line_number":30,"context_line":"# slapping 0x in front of every character or woulden\u0027t accept a bin array"},{"line_number":31,"context_line":"hex_chars \u003d \"0123456789abcdef\""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_a4ad839c","line":30,"in_reply_to":"9a41bdd9_26d5fbe6","updated":"2015-07-15 17:19:03.000000000","message":"I would be glad if some one found the more pythonic way to do this it would be great cause I hate reinventing to_hex on every project I go to. :(","commit_id":"526880c8eae945df33ad1c382fd3ebf9f71a7fb9"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"44cd11f18068527dd8db0a73412b32055cb3174d","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"hash_algo \u003d hashlib.sha256"},{"line_number":25,"context_line":"hash_len \u003d 32"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def to_hex(byte_array):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_0e1a5e7d","line":25,"updated":"2015-07-22 21:59:36.000000000","message":"May be get it from constants ?","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"44cd11f18068527dd8db0a73412b32055cb3174d","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def encode_obj(obj):"},{"line_number":33,"context_line":"    json_bytes \u003d json.dumps(obj).encode(\u0027utf-8\u0027)"},{"line_number":34,"context_line":"    binary_array \u003d zlib.compress(json_bytes, 9)"},{"line_number":35,"context_line":"    return binary_array"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_046c7ecc","line":34,"updated":"2015-07-22 21:59:36.000000000","message":"Is compression level always fixed to 9?","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"221c8f0135179eaa9884170d6113b54331504c61","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def encode_obj(obj):"},{"line_number":33,"context_line":"    json_bytes \u003d json.dumps(obj).encode(\u0027utf-8\u0027)"},{"line_number":34,"context_line":"    binary_array \u003d zlib.compress(json_bytes, 9)"},{"line_number":35,"context_line":"    return binary_array"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_4d3aa9e8","line":34,"in_reply_to":"3a50d1a3_046c7ecc","updated":"2015-07-22 23:22:54.000000000","message":"yes.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"a1c1f8fa5e588a3b2b8c942b2556f342ec541898","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"def get_hmac(payload, key):"},{"line_number":64,"context_line":"    hmc \u003d hmac.new(key.encode(\"utf-8\"), payload, hashlib.sha256)"},{"line_number":65,"context_line":"    return hmc.digest()"}],"source_content_type":"text/x-python","patch_set":29,"id":"1a4dcd0f_15b2dfe5","line":64,"updated":"2015-08-15 00:16:15.000000000","message":"Do we really need sha256 for health messages?  Seems a bit computationally intensive for our needs.","commit_id":"f08b10f1f76f6818b0df2540ce9fd7145c6164b2"}],"octavia/amphorae/drivers/health/heartbeat_udp.py":[{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"fcb407f8afd90121b52914116b02099f4c53eb2b","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        try:"},{"line_number":174,"context_line":"            (obj, srcaddr) \u003d self.dorecv()"},{"line_number":175,"context_line":"            if self.health_update:"},{"line_number":176,"context_line":"                self.executor.submit(self.health_update.update_health, obj)"},{"line_number":177,"context_line":"            if self.stats_update:"},{"line_number":178,"context_line":"                self.executor.submit(self.stats_update.update_stats, obj)"},{"line_number":179,"context_line":"        except exceptions.InvalidHMACException:"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_4fa3b1b2","line":176,"updated":"2015-08-28 17:50:12.000000000","message":"not sure if I agree to put the heartbeat update into that part. I think that is time sensitive since it triggers failures - so lumping it in with (longer)running health updates might not be ideal","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"ef6fd742c551971a472fb95a346ae9ac9acefda3","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        try:"},{"line_number":174,"context_line":"            (obj, srcaddr) \u003d self.dorecv()"},{"line_number":175,"context_line":"            if self.health_update:"},{"line_number":176,"context_line":"                self.executor.submit(self.health_update.update_health, obj)"},{"line_number":177,"context_line":"            if self.stats_update:"},{"line_number":178,"context_line":"                self.executor.submit(self.stats_update.update_stats, obj)"},{"line_number":179,"context_line":"        except exceptions.InvalidHMACException:"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_7d2d0f94","line":176,"in_reply_to":"da20952f_4fa3b1b2","updated":"2015-08-28 18:17:47.000000000","message":"I did this because we need to check the lb health before marking it healthy in the db.  We could split this out in another thread if we think we need it.","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"}],"octavia/cmd/health_manager.py":[{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"3c1263eba5896c696eaed040e647950ec2075be8","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        self.ip \u003d ip"},{"line_number":34,"context_line":"        self.port \u003d port"},{"line_number":35,"context_line":"        self.sock \u003d None"},{"line_number":36,"context_line":"        for addrinfo in socket.getaddrinfo(ip, port, 0, socket.SOCK_DGRAM):"},{"line_number":37,"context_line":"            print(\"addrinfo \u003d {0}\".format(addrinfo))"},{"line_number":38,"context_line":"            ai_family \u003d addrinfo[0]"},{"line_number":39,"context_line":"            self.sockaddr \u003d addrinfo[4]"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_64c9bb58","line":36,"updated":"2015-07-15 17:19:03.000000000","message":"for got to get rid of this print statement.","commit_id":"526880c8eae945df33ad1c382fd3ebf9f71a7fb9"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"3c1263eba5896c696eaed040e647950ec2075be8","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        self.key \u003d key"},{"line_number":48,"context_line":"        self.sock \u003d None"},{"line_number":49,"context_line":"        for addrinfo in socket.getaddrinfo(ip, port, 0, socket.SOCK_DGRAM):"},{"line_number":50,"context_line":"            ai_family \u003d addrinfo[0]"},{"line_number":51,"context_line":"            self.sockaddr \u003d addrinfo[4]"},{"line_number":52,"context_line":"            self.sock \u003d socket.socket(ai_family, socket.SOCK_DGRAM)"},{"line_number":53,"context_line":"            self.sock.bind((ip, port))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_bf77ca9e","line":50,"updated":"2015-07-15 17:19:03.000000000","message":"ai_family is \nsocket.AF_INET for pv4\n and socket.AF_INET6 \u003d ipv6","commit_id":"526880c8eae945df33ad1c382fd3ebf9f71a7fb9"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"44cd11f18068527dd8db0a73412b32055cb3174d","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.sock \u003d None"},{"line_number":42,"context_line":"        for addrinfo in socket.getaddrinfo(self.ip, self.port, 0,"},{"line_number":43,"context_line":"                                           socket.SOCK_DGRAM):"},{"line_number":44,"context_line":"            print(\"addrinfo \u003d {0}\".format(addrinfo))"},{"line_number":45,"context_line":"            ai_family \u003d addrinfo[0]"},{"line_number":46,"context_line":"            self.sockaddr \u003d addrinfo[4]"},{"line_number":47,"context_line":"            self.sock \u003d socket.socket(ai_family, socket.SOCK_DGRAM)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_645a22f4","line":44,"updated":"2015-07-22 21:59:36.000000000","message":"log it instead.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"44cd11f18068527dd8db0a73412b32055cb3174d","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    def update(self, key, ip, port):"},{"line_number":54,"context_line":"        self.key \u003d key"},{"line_number":55,"context_line":"        self.sock \u003d None"},{"line_number":56,"context_line":"        for addrinfo in socket.getaddrinfo(ip, port, 0, socket.SOCK_DGRAM):"},{"line_number":57,"context_line":"            ai_family \u003d addrinfo[0]"},{"line_number":58,"context_line":"            self.sockaddr \u003d addrinfo[4]"},{"line_number":59,"context_line":"            self.sock \u003d socket.socket(ai_family, socket.SOCK_DGRAM)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_649b0267","line":56,"updated":"2015-07-22 21:59:36.000000000","message":"This whole code is repeated above.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"221c8f0135179eaa9884170d6113b54331504c61","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    def update(self, key, ip, port):"},{"line_number":54,"context_line":"        self.key \u003d key"},{"line_number":55,"context_line":"        self.sock \u003d None"},{"line_number":56,"context_line":"        for addrinfo in socket.getaddrinfo(ip, port, 0, socket.SOCK_DGRAM):"},{"line_number":57,"context_line":"            ai_family \u003d addrinfo[0]"},{"line_number":58,"context_line":"            self.sockaddr \u003d addrinfo[4]"},{"line_number":59,"context_line":"            self.sock \u003d socket.socket(ai_family, socket.SOCK_DGRAM)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_b87a8986","line":56,"in_reply_to":"3a50d1a3_649b0267","updated":"2015-07-22 23:22:54.000000000","message":"I\u0027ll replace it with self.update later which I thought I did.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"44cd11f18068527dd8db0a73412b32055cb3174d","unresolved":false,"context_lines":[{"line_number":63,"context_line":"            raise exceptions.NetworkConfig(\"unable to find suitable socket\")"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def dorecv(self):"},{"line_number":66,"context_line":"        (data, srcaddr) \u003d self.sock.recvfrom(65535)  # no more then 64k"},{"line_number":67,"context_line":"        obj \u003d status_message.unwrap_envelope(data, self.key)"},{"line_number":68,"context_line":"        return (obj, srcaddr)"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_24d09af5","line":66,"updated":"2015-07-22 21:59:36.000000000","message":"use constants for 65535?","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"44cd11f18068527dd8db0a73412b32055cb3174d","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    udp_getter \u003d UDPStatusGetter()"},{"line_number":74,"context_line":"    repo \u003d repositories.Repositories().amphorahealth"},{"line_number":75,"context_line":"    session \u003d api.get_session()"},{"line_number":76,"context_line":"    while True:"},{"line_number":77,"context_line":"        try:"},{"line_number":78,"context_line":"            # todo fork this out later or spawn a thread"},{"line_number":79,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_048d5ed5","line":76,"updated":"2015-07-22 21:59:36.000000000","message":"will this loop continuously without taking a break?","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"221c8f0135179eaa9884170d6113b54331504c61","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    udp_getter \u003d UDPStatusGetter()"},{"line_number":74,"context_line":"    repo \u003d repositories.Repositories().amphorahealth"},{"line_number":75,"context_line":"    session \u003d api.get_session()"},{"line_number":76,"context_line":"    while True:"},{"line_number":77,"context_line":"        try:"},{"line_number":78,"context_line":"            # todo fork this out later or spawn a thread"},{"line_number":79,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_386759ea","line":76,"in_reply_to":"3a50d1a3_048d5ed5","updated":"2015-07-22 23:22:54.000000000","message":"It will block waiting for a udp packet. Its still event driven.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"938d3f1771268e79c77721522f55cc3ca48e44b5","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    udp_getter \u003d UDPStatusGetter()"},{"line_number":74,"context_line":"    repo \u003d repositories.Repositories().amphorahealth"},{"line_number":75,"context_line":"    session \u003d api.get_session()"},{"line_number":76,"context_line":"    while True:"},{"line_number":77,"context_line":"        try:"},{"line_number":78,"context_line":"            # todo fork this out later or spawn a thread"},{"line_number":79,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_a7e34cd8","line":76,"in_reply_to":"3a50d1a3_048d5ed5","updated":"2015-07-22 22:08:32.000000000","message":"without a break I mean sleep :)","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"d0dced8d79589e223fb069b65735768e242f314a","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    while True:"},{"line_number":77,"context_line":"        try:"},{"line_number":78,"context_line":"            # todo fork this out later or spawn a thread"},{"line_number":79,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"},{"line_number":80,"context_line":"            pkt_counter +\u003d 1"},{"line_number":81,"context_line":"            if(pkt_counter % 1000 \u003d\u003d 0):"},{"line_number":82,"context_line":"                print(\"{0} packets recieved\".format(pkt_counter))"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_9b407909","line":79,"updated":"2015-07-24 17:17:50.000000000","message":"This is not setup as a server so it will fail other connections while it\u0027s processing this one.  This needs to be re-worked.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"525d0529dcdae90e864c409c927fe08b43d6ac58","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    while True:"},{"line_number":77,"context_line":"        try:"},{"line_number":78,"context_line":"            # todo fork this out later or spawn a thread"},{"line_number":79,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"},{"line_number":80,"context_line":"            pkt_counter +\u003d 1"},{"line_number":81,"context_line":"            if(pkt_counter % 1000 \u003d\u003d 0):"},{"line_number":82,"context_line":"                print(\"{0} packets recieved\".format(pkt_counter))"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_72e300da","line":79,"in_reply_to":"3a50d1a3_9b407909","updated":"2015-07-29 04:28:38.000000000","message":"I assume your refeering to a forking or threaded listener but the problem remains that even if it is threaded out MySQL will not be able to catch up to the UDP packets comming in. especially if you get alot of bursting. I\u0027ve observed that we can get about 250 message to stack up in UDP before packets start getting dropped.  I\u0027ve tried to smooth it out with an endless Queue.Queue()/queue.Queue() system which is successfull in captureing all the UDP traffic with a seperate thread handling the writes the trouble is the queue will just keep growing untill I stop sending packets.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"44cd11f18068527dd8db0a73412b32055cb3174d","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"},{"line_number":80,"context_line":"            pkt_counter +\u003d 1"},{"line_number":81,"context_line":"            if(pkt_counter % 1000 \u003d\u003d 0):"},{"line_number":82,"context_line":"                print(\"{0} packets recieved\".format(pkt_counter))"},{"line_number":83,"context_line":"            amphora_id \u003d obj[\u0027id\u0027]"},{"line_number":84,"context_line":"            ah \u003d models.AmphoraHealth()"},{"line_number":85,"context_line":"            ah.amphora_id \u003d amphora_id"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_c4f1b696","line":82,"updated":"2015-07-22 21:59:36.000000000","message":"log instead","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":10477,"name":"min wang","email":"swiftwangster@gmail.com","username":"minwang"},"change_message_id":"6a16993ff7553cf410db5e9b249217183959561e","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            amphora_id \u003d obj[\u0027id\u0027]"},{"line_number":84,"context_line":"            ah \u003d models.AmphoraHealth()"},{"line_number":85,"context_line":"            ah.amphora_id \u003d amphora_id"},{"line_number":86,"context_line":"            ah.last_update \u003d datetime.datetime.utcnow()"},{"line_number":87,"context_line":"            session.merge(ah)"},{"line_number":88,"context_line":"        except exceptions.InvalidHMACException:"},{"line_number":89,"context_line":"            pass  # Just log and try next"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_245c1a4a","line":86,"updated":"2015-07-28 21:32:04.000000000","message":"since now amphora health table add a new column: busy, which is boolean, you may need to assign it here as well, its default value is false, which means that you can do failover with it, once it becomes true, that means the corresponding amphora is being failed over.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"525d0529dcdae90e864c409c927fe08b43d6ac58","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            amphora_id \u003d obj[\u0027id\u0027]"},{"line_number":84,"context_line":"            ah \u003d models.AmphoraHealth()"},{"line_number":85,"context_line":"            ah.amphora_id \u003d amphora_id"},{"line_number":86,"context_line":"            ah.last_update \u003d datetime.datetime.utcnow()"},{"line_number":87,"context_line":"            session.merge(ah)"},{"line_number":88,"context_line":"        except exceptions.InvalidHMACException:"},{"line_number":89,"context_line":"            pass  # Just log and try next"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_9a421a0e","line":86,"in_reply_to":"3a50d1a3_245c1a4a","updated":"2015-07-29 04:28:38.000000000","message":"I will not modify the boolean value. I\u0027ll only update the last time stamp with the repo replace command in the next patchset.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"d0dced8d79589e223fb069b65735768e242f314a","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            ah \u003d models.AmphoraHealth()"},{"line_number":85,"context_line":"            ah.amphora_id \u003d amphora_id"},{"line_number":86,"context_line":"            ah.last_update \u003d datetime.datetime.utcnow()"},{"line_number":87,"context_line":"            session.merge(ah)"},{"line_number":88,"context_line":"        except exceptions.InvalidHMACException:"},{"line_number":89,"context_line":"            pass  # Just log and try next"},{"line_number":90,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_bbaf7593","line":87,"updated":"2015-07-24 17:17:50.000000000","message":"When using a stock Octavia devstack install and calling the existing repository methods for insert and update (similar to the mix-in code) I had no errors doing 100, 1000, and 5000 amphora updating.  The time scaled as expected for an un-optimized table.  I had no errors.\nI think the issue you are seeing is with this loop.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"525d0529dcdae90e864c409c927fe08b43d6ac58","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            ah \u003d models.AmphoraHealth()"},{"line_number":85,"context_line":"            ah.amphora_id \u003d amphora_id"},{"line_number":86,"context_line":"            ah.last_update \u003d datetime.datetime.utcnow()"},{"line_number":87,"context_line":"            session.merge(ah)"},{"line_number":88,"context_line":"        except exceptions.InvalidHMACException:"},{"line_number":89,"context_line":"            pass  # Just log and try next"},{"line_number":90,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_9ade9a3c","line":87,"in_reply_to":"3a50d1a3_bbaf7593","updated":"2015-07-29 04:28:38.000000000","message":"just to be safe I\u0027m using setsockopt to increase the udp receive buffer to smooth out the jitter context switching between the db writer thread and the udp listener thread in the next patchset.","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"d0dced8d79589e223fb069b65735768e242f314a","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def main(argv):"},{"line_number":95,"context_line":"    service.prepare_service(sys.argv)"},{"line_number":96,"context_line":"    listener_loop()"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"if __name__ \u003d\u003d \"__main__\":"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_7bf6cdd8","line":96,"updated":"2015-07-24 17:17:50.000000000","message":"The other code should be pulled out to a separate file","commit_id":"2ab69c5b198230f4128bbbe0502a0a91c9ca0b36"}],"octavia/cmd/heartbeat_udp.py":[{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"185ac98bcad0cf1ff74b337d73b1f08dc6ce1977","unresolved":false,"context_lines":[{"line_number":10,"context_line":"#    distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT"},{"line_number":11,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import datetime"},{"line_number":16,"context_line":"import socket"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_c543b012","line":13,"updated":"2015-07-30 00:29:50.000000000","message":"Only commands should be in cmd - modules should be in another place in the tree. Please move the file.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"if six.PY2:"},{"line_number":33,"context_line":"    import Queue"},{"line_number":34,"context_line":"    q \u003d Queue.Queue()"},{"line_number":35,"context_line":"elif six.PY3:"},{"line_number":36,"context_line":"    import queue"},{"line_number":37,"context_line":"    q \u003d queue.Queue()"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_819367a2","line":34,"updated":"2015-07-30 19:21:15.000000000","message":"needs a better, more descriptive name than q.  perhaps received_heartbeats?","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"185ac98bcad0cf1ff74b337d73b1f08dc6ce1977","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def dorecv(self):"},{"line_number":73,"context_line":"        (data, srcaddr) \u003d self.sock.recvfrom(UDP_MAX_SIZE)"},{"line_number":74,"context_line":"        obj \u003d status_message.unwrap_envelope(data, self.key)"},{"line_number":75,"context_line":"        return (obj, srcaddr)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_c55ad0f2","line":74,"updated":"2015-07-30 00:29:50.000000000","message":"should the unwrapping not be part of the additional threads to save CPU for receiving?","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"51119abdd956e9af1f6c7da317f4b24e41074a1e","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def dorecv(self):"},{"line_number":73,"context_line":"        (data, srcaddr) \u003d self.sock.recvfrom(UDP_MAX_SIZE)"},{"line_number":74,"context_line":"        obj \u003d status_message.unwrap_envelope(data, self.key)"},{"line_number":75,"context_line":"        return (obj, srcaddr)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_085e5612","line":74,"in_reply_to":"3a50d1a3_75f49c86","updated":"2015-07-31 03:38:23.000000000","message":"Do you believe a standard PC CPU can\u0027t decompress 30KB of data per second? We\u0027ve demonstrated that even with the redis the UDP reciever has no trouble outrunning the mysql and redis writer.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"69f0ed10663ac128dcf3f6130a55393b096f4526","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def dorecv(self):"},{"line_number":73,"context_line":"        (data, srcaddr) \u003d self.sock.recvfrom(UDP_MAX_SIZE)"},{"line_number":74,"context_line":"        obj \u003d status_message.unwrap_envelope(data, self.key)"},{"line_number":75,"context_line":"        return (obj, srcaddr)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_75f49c86","line":74,"in_reply_to":"3a50d1a3_92561ecd","updated":"2015-07-30 19:56:58.000000000","message":"I mean to save CPU for the receiving thread so we can receive more messages. I am only used to more real multi processing and there you would move anything not necessary to the other (less time critical) threads... so deferring the unwrapping to the other thread should allow you to be more responsive here...","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def dorecv(self):"},{"line_number":73,"context_line":"        (data, srcaddr) \u003d self.sock.recvfrom(UDP_MAX_SIZE)"},{"line_number":74,"context_line":"        obj \u003d status_message.unwrap_envelope(data, self.key)"},{"line_number":75,"context_line":"        return (obj, srcaddr)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_92561ecd","line":74,"in_reply_to":"3a50d1a3_c55ad0f2","updated":"2015-07-30 19:21:15.000000000","message":"i\u0027m not sure this would really save any CPU as we\u0027re really only guaranteed one thread at a time (GIL).  so unwrapping is still going to take up CPU time anyway.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    counter \u003d 0"},{"line_number":81,"context_line":"    while True:"},{"line_number":82,"context_line":"        try:"},{"line_number":83,"context_line":"            # todo fork this out later or spawn a thread"},{"line_number":84,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"},{"line_number":85,"context_line":"            amphora_id \u003d obj[\u0027id\u0027]"},{"line_number":86,"context_line":"            q.put(amphora_id)  # Get back to UDP reading asap."}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_e1002b03","line":83,"updated":"2015-07-30 19:21:15.000000000","message":"proper format is \n\n# TODO(name): message","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"d2014d549a3ab046688cb6585be331b95082f248","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            # todo fork this out later or spawn a thread"},{"line_number":84,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"},{"line_number":85,"context_line":"            amphora_id \u003d obj[\u0027id\u0027]"},{"line_number":86,"context_line":"            q.put(amphora_id)  # Get back to UDP reading asap."},{"line_number":87,"context_line":"            counter +\u003d 1"},{"line_number":88,"context_line":"            if counter % 1000 \u003d\u003d 0:"},{"line_number":89,"context_line":"                LOG.info(_LI(\"received {0} packets qsize is {1}\").format("}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_96907c50","line":86,"updated":"2015-07-30 02:00:58.000000000","message":"needs lock?","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            # todo fork this out later or spawn a thread"},{"line_number":84,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"},{"line_number":85,"context_line":"            amphora_id \u003d obj[\u0027id\u0027]"},{"line_number":86,"context_line":"            q.put(amphora_id)  # Get back to UDP reading asap."},{"line_number":87,"context_line":"            counter +\u003d 1"},{"line_number":88,"context_line":"            if counter % 1000 \u003d\u003d 0:"},{"line_number":89,"context_line":"                LOG.info(_LI(\"received {0} packets qsize is {1}\").format("}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_f229a28a","line":86,"in_reply_to":"3a50d1a3_96907c50","updated":"2015-07-30 19:21:15.000000000","message":"python Queues are thread safe","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"51119abdd956e9af1f6c7da317f4b24e41074a1e","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            # todo fork this out later or spawn a thread"},{"line_number":84,"context_line":"            (obj, srcaddr) \u003d udp_getter.dorecv()"},{"line_number":85,"context_line":"            amphora_id \u003d obj[\u0027id\u0027]"},{"line_number":86,"context_line":"            q.put(amphora_id)  # Get back to UDP reading asap."},{"line_number":87,"context_line":"            counter +\u003d 1"},{"line_number":88,"context_line":"            if counter % 1000 \u003d\u003d 0:"},{"line_number":89,"context_line":"                LOG.info(_LI(\"received {0} packets qsize is {1}\").format("}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_e8bc4a08","line":86,"in_reply_to":"3a50d1a3_f229a28a","updated":"2015-07-31 03:38:23.000000000","message":"correct they are.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"185ac98bcad0cf1ff74b337d73b1f08dc6ce1977","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            raise"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"def writer_loop():"},{"line_number":98,"context_line":"    session \u003d api.get_session()"},{"line_number":99,"context_line":"    repo \u003d repositories.Repositories().amphorahealth"},{"line_number":100,"context_line":"    counter \u003d 0"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_e5b7ccf6","line":97,"updated":"2015-07-30 00:29:50.000000000","message":"the writer should be sort of a thread pool, aka like N thread working on it - see below","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":17419,"name":"Banashankar k","email":"banveerad@gmail.com","username":"banveerad"},"change_message_id":"d2014d549a3ab046688cb6585be331b95082f248","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    counter \u003d 0"},{"line_number":101,"context_line":"    while True:"},{"line_number":102,"context_line":"        counter +\u003d 1"},{"line_number":103,"context_line":"        amphora_id \u003d q.get()"},{"line_number":104,"context_line":"        n_items \u003d q.qsize()"},{"line_number":105,"context_line":"        if n_items \u003e\u003d 250 and counter % 1000 \u003d\u003d 0:"},{"line_number":106,"context_line":"            LOG.debug(_LI(\u0027warning qsize is {0}\u0027).format(n_items))"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_2b9d8566","line":103,"updated":"2015-07-30 02:00:58.000000000","message":"there should be a lock around the q?","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    counter \u003d 0"},{"line_number":101,"context_line":"    while True:"},{"line_number":102,"context_line":"        counter +\u003d 1"},{"line_number":103,"context_line":"        amphora_id \u003d q.get()"},{"line_number":104,"context_line":"        n_items \u003d q.qsize()"},{"line_number":105,"context_line":"        if n_items \u003e\u003d 250 and counter % 1000 \u003d\u003d 0:"},{"line_number":106,"context_line":"            LOG.debug(_LI(\u0027warning qsize is {0}\u0027).format(n_items))"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_92a37e00","line":103,"in_reply_to":"3a50d1a3_2b9d8566","updated":"2015-07-30 19:21:15.000000000","message":"python Queues are thread safe","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"51119abdd956e9af1f6c7da317f4b24e41074a1e","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    counter \u003d 0"},{"line_number":101,"context_line":"    while True:"},{"line_number":102,"context_line":"        counter +\u003d 1"},{"line_number":103,"context_line":"        amphora_id \u003d q.get()"},{"line_number":104,"context_line":"        n_items \u003d q.qsize()"},{"line_number":105,"context_line":"        if n_items \u003e\u003d 250 and counter % 1000 \u003d\u003d 0:"},{"line_number":106,"context_line":"            LOG.debug(_LI(\u0027warning qsize is {0}\u0027).format(n_items))"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_085176d8","line":103,"in_reply_to":"3a50d1a3_2b9d8566","updated":"2015-07-31 03:38:23.000000000","message":"python Queues are thread safe. Back in the day I used to think the same thing.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"185ac98bcad0cf1ff74b337d73b1f08dc6ce1977","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        n_items \u003d q.qsize()"},{"line_number":105,"context_line":"        if n_items \u003e\u003d 250 and counter % 1000 \u003d\u003d 0:"},{"line_number":106,"context_line":"            LOG.debug(_LI(\u0027warning qsize is {0}\u0027).format(n_items))"},{"line_number":107,"context_line":"        repo.replace(session, amphora_id,"},{"line_number":108,"context_line":"                     last_update\u003ddatetime.datetime.utcnow())"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_70113853","line":107,"updated":"2015-07-30 00:29:50.000000000","message":"Is there a reason we shun the mixin? After all we should be sending health of each listener/member as well... Please replace with a call to the mixin","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        n_items \u003d q.qsize()"},{"line_number":105,"context_line":"        if n_items \u003e\u003d 250 and counter % 1000 \u003d\u003d 0:"},{"line_number":106,"context_line":"            LOG.debug(_LI(\u0027warning qsize is {0}\u0027).format(n_items))"},{"line_number":107,"context_line":"        repo.replace(session, amphora_id,"},{"line_number":108,"context_line":"                     last_update\u003ddatetime.datetime.utcnow())"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_92f13e04","line":107,"in_reply_to":"3a50d1a3_70113853","updated":"2015-07-30 19:21:15.000000000","message":"I\u0027m pretty sure we agreed that the mixin didn\u0027t make sense since we decided there\u0027s no reason to couple the health manager and the amphora driver.  That mixin was designed to be a mixin for the amphora driver, thus meaning once you have an amphora driver selected you\u0027ve also got the health manager, which is tightly coupling them.  Now there should be some kind of interface a health manager follows though, but I\u0027m not sure if we ever talked about that.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"69f0ed10663ac128dcf3f6130a55393b096f4526","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        n_items \u003d q.qsize()"},{"line_number":105,"context_line":"        if n_items \u003e\u003d 250 and counter % 1000 \u003d\u003d 0:"},{"line_number":106,"context_line":"            LOG.debug(_LI(\u0027warning qsize is {0}\u0027).format(n_items))"},{"line_number":107,"context_line":"        repo.replace(session, amphora_id,"},{"line_number":108,"context_line":"                     last_update\u003ddatetime.datetime.utcnow())"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_b50f8487","line":107,"in_reply_to":"3a50d1a3_92f13e04","updated":"2015-07-30 19:56:58.000000000","message":"Yes. We should have an interface for that so we can easily swap mysql for Redis. I was thinking about reusing the mixin in some form but I am happy to entertain other ideas.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"185ac98bcad0cf1ff74b337d73b1f08dc6ce1977","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                     last_update\u003ddatetime.datetime.utcnow())"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"def launch_udp_server():"},{"line_number":112,"context_line":"    udp_thread \u003d threading.Thread(target\u003dudp_loop)"},{"line_number":113,"context_line":"    writer_thread \u003d threading.Thread(target\u003dwriter_loop)"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_85c9287c","line":111,"updated":"2015-07-30 00:29:50.000000000","message":"this is obsolete. Min will launch the process as part of her health manager","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"de5aab25804f618b044364725b8984a07f7313a7","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                     last_update\u003ddatetime.datetime.utcnow())"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"def launch_udp_server():"},{"line_number":112,"context_line":"    udp_thread \u003d threading.Thread(target\u003dudp_loop)"},{"line_number":113,"context_line":"    writer_thread \u003d threading.Thread(target\u003dwriter_loop)"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_52017638","line":111,"in_reply_to":"3a50d1a3_12bd2e02","updated":"2015-07-30 19:33:36.000000000","message":"well nvm, min\u0027s reviews has the migrations that carlos\u0027s will need as well.  carlos will need to depend his on this.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"51119abdd956e9af1f6c7da317f4b24e41074a1e","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                     last_update\u003ddatetime.datetime.utcnow())"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"def launch_udp_server():"},{"line_number":112,"context_line":"    udp_thread \u003d threading.Thread(target\u003dudp_loop)"},{"line_number":113,"context_line":"    writer_thread \u003d threading.Thread(target\u003dwriter_loop)"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_c8086edc","line":111,"in_reply_to":"3a50d1a3_52017638","updated":"2015-07-31 03:38:23.000000000","message":"I originally had the migrations on mine but I removed them after min duplicated them resulting in merge conflicts during a test merge.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                     last_update\u003ddatetime.datetime.utcnow())"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"def launch_udp_server():"},{"line_number":112,"context_line":"    udp_thread \u003d threading.Thread(target\u003dudp_loop)"},{"line_number":113,"context_line":"    writer_thread \u003d threading.Thread(target\u003dwriter_loop)"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_12bd2e02","line":111,"in_reply_to":"3a50d1a3_85c9287c","updated":"2015-07-30 19:21:15.000000000","message":"min\u0027s is dependent on a few reviews, this doesn\u0027t need to be dependent on any if this code launches the udp server.  just to save having to go through that dependency chain, i\u0027d prefer it to just be done here.  if changes need to be made, then once this merges min can make the changes.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"185ac98bcad0cf1ff74b337d73b1f08dc6ce1977","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    writer_thread.setDaemon(True)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    udp_thread.start()"},{"line_number":119,"context_line":"    writer_thread.start()"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_c5d3b0d4","line":119,"updated":"2015-07-30 00:29:50.000000000","message":"ok, you need to get rid of the queue and make a ThreadPool instead (see https://docs.python.org/3/library/concurrent.futures.html - there should be some Python 2 version as well). Then all you do is do a submit of each packet... and we configure like N threads a","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"a9910f144ae22480682ac42e130ffee5cd2ec00f","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    writer_thread.setDaemon(True)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    udp_thread.start()"},{"line_number":119,"context_line":"    writer_thread.start()"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_c1fee404","line":119,"in_reply_to":"3a50d1a3_a8dba220","updated":"2015-07-31 17:34:48.000000000","message":"I\u0027m going to remove the startup code so that min can wire it up in the health manager. I think this would be simplest. She can spawn off a threads to handle the UDP reciever and the ThreadPool to handle the the writes to the data base.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"51119abdd956e9af1f6c7da317f4b24e41074a1e","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    writer_thread.setDaemon(True)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    udp_thread.start()"},{"line_number":119,"context_line":"    writer_thread.start()"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_a8dba220","line":119,"in_reply_to":"3a50d1a3_c5d3b0d4","updated":"2015-07-31 03:38:23.000000000","message":"I discussed this with brandon originally but then realized this is pretty moot considering were stuck with MySQL as a message bus.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"}],"octavia/common/config.py":[{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"7ae49146fc55315d6cb4f6e937cf1d8d13783932","unresolved":false,"context_lines":[{"line_number":88,"context_line":"               help\u003d_(\u0027key used to validate amphora sending\u0027"},{"line_number":89,"context_line":"                      \u0027the message\u0027)),"},{"line_number":90,"context_line":"    cfg.IntOpt(\u0027sock_rlimit\u0027, default\u003d0,"},{"line_number":91,"context_line":"               help\u003d_(\u0027 sets the value of the heartbeat recv buffer\u0027))"},{"line_number":92,"context_line":"]"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"networking_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_e106ebcc","line":91,"updated":"2015-07-30 19:21:15.000000000","message":"need to add this to the octavia/etc/octavia.conf file as an example","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"51119abdd956e9af1f6c7da317f4b24e41074a1e","unresolved":false,"context_lines":[{"line_number":88,"context_line":"               help\u003d_(\u0027key used to validate amphora sending\u0027"},{"line_number":89,"context_line":"                      \u0027the message\u0027)),"},{"line_number":90,"context_line":"    cfg.IntOpt(\u0027sock_rlimit\u0027, default\u003d0,"},{"line_number":91,"context_line":"               help\u003d_(\u0027 sets the value of the heartbeat recv buffer\u0027))"},{"line_number":92,"context_line":"]"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"networking_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_28d0f2f6","line":91,"in_reply_to":"3a50d1a3_e106ebcc","updated":"2015-07-31 03:38:23.000000000","message":"I will.","commit_id":"5cd0bc24af06cfeb9d6c4e3f7d61a3d24309400a"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"fcb407f8afd90121b52914116b02099f4c53eb2b","unresolved":false,"context_lines":[{"line_number":100,"context_line":"]"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"healthmanager_opts \u003d ["},{"line_number":103,"context_line":"    cfg.StrOpt(\u0027bind_ip\u0027, default\u003d\u00270.0.0.0\u0027,"},{"line_number":104,"context_line":"               help\u003d_(\u0027IP address the controller will listen on for \u0027"},{"line_number":105,"context_line":"                      \u0027heart beats\u0027)),"},{"line_number":106,"context_line":"    cfg.IntOpt(\u0027bind_port\u0027, default\u003d5555,"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_8fab0975","line":103,"updated":"2015-08-28 17:50:12.000000000","message":"mmh, we should be more precise","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"ef6fd742c551971a472fb95a346ae9ac9acefda3","unresolved":false,"context_lines":[{"line_number":100,"context_line":"]"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"healthmanager_opts \u003d ["},{"line_number":103,"context_line":"    cfg.StrOpt(\u0027bind_ip\u0027, default\u003d\u00270.0.0.0\u0027,"},{"line_number":104,"context_line":"               help\u003d_(\u0027IP address the controller will listen on for \u0027"},{"line_number":105,"context_line":"                      \u0027heart beats\u0027)),"},{"line_number":106,"context_line":"    cfg.IntOpt(\u0027bind_port\u0027, default\u003d5555,"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_12dba250","line":103,"in_reply_to":"da20952f_8fab0975","updated":"2015-08-28 18:17:47.000000000","message":"Yes, will be addressed by:\nhttps://bugs.launchpad.net/octavia/+bug/1489963","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"fcb407f8afd90121b52914116b02099f4c53eb2b","unresolved":false,"context_lines":[{"line_number":116,"context_line":"               help\u003d_(\u0027key used to validate amphora sending\u0027"},{"line_number":117,"context_line":"                      \u0027the message\u0027), secret\u003dTrue),"},{"line_number":118,"context_line":"    cfg.IntOpt(\u0027heartbeat_timeout\u0027,"},{"line_number":119,"context_line":"               default\u003d30,"},{"line_number":120,"context_line":"               help\u003d_(\u0027Interval, in seconds, to wait before failing over an \u0027"},{"line_number":121,"context_line":"                      \u0027amphora.\u0027)),"},{"line_number":122,"context_line":"    cfg.IntOpt(\u0027health_check_interval\u0027,"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_8fc22933","line":119,"updated":"2015-08-28 17:50:12.000000000","message":"that might still be aggressive... Libra was about 60-90 which is defensible if we have ACTIVE-PASSIVE","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"257f88fd82094ee8c6d6d79dae95b735d1c93562","unresolved":false,"context_lines":[{"line_number":116,"context_line":"               help\u003d_(\u0027key used to validate amphora sending\u0027"},{"line_number":117,"context_line":"                      \u0027the message\u0027), secret\u003dTrue),"},{"line_number":118,"context_line":"    cfg.IntOpt(\u0027heartbeat_timeout\u0027,"},{"line_number":119,"context_line":"               default\u003d30,"},{"line_number":120,"context_line":"               help\u003d_(\u0027Interval, in seconds, to wait before failing over an \u0027"},{"line_number":121,"context_line":"                      \u0027amphora.\u0027)),"},{"line_number":122,"context_line":"    cfg.IntOpt(\u0027health_check_interval\u0027,"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_5ddfeb0c","line":119,"in_reply_to":"da20952f_72c1be53","updated":"2015-08-28 18:55:33.000000000","message":"Go for it. We can lower it in our config file.","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"ef6fd742c551971a472fb95a346ae9ac9acefda3","unresolved":false,"context_lines":[{"line_number":116,"context_line":"               help\u003d_(\u0027key used to validate amphora sending\u0027"},{"line_number":117,"context_line":"                      \u0027the message\u0027), secret\u003dTrue),"},{"line_number":118,"context_line":"    cfg.IntOpt(\u0027heartbeat_timeout\u0027,"},{"line_number":119,"context_line":"               default\u003d30,"},{"line_number":120,"context_line":"               help\u003d_(\u0027Interval, in seconds, to wait before failing over an \u0027"},{"line_number":121,"context_line":"                      \u0027amphora.\u0027)),"},{"line_number":122,"context_line":"    cfg.IntOpt(\u0027health_check_interval\u0027,"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_72c1be53","line":119,"in_reply_to":"da20952f_8fc22933","updated":"2015-08-28 18:17:47.000000000","message":"Agreed.  I can bump this.","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"},{"author":{"_account_id":8157,"name":"Bertrand LALLAU","email":"bertrand.lallau@gmail.com","username":"blallau"},"change_message_id":"a0f58b0d82cb3d9311653a0fd1e562f9baff5b9e","unresolved":false,"context_lines":[{"line_number":265,"context_line":""},{"line_number":266,"context_line":"# Register the configuration options"},{"line_number":267,"context_line":"cfg.CONF.register_opts(core_opts)"},{"line_number":268,"context_line":"cfg.CONF.register_opts(amphora_agent_opts, group\u003d\u0027amphora_agent\u0027)"},{"line_number":269,"context_line":"cfg.CONF.register_opts(networking_opts, group\u003d\u0027networking\u0027)"},{"line_number":270,"context_line":"cfg.CONF.register_opts(oslo_messaging_opts, group\u003d\u0027oslo_messaging\u0027)"},{"line_number":271,"context_line":"cfg.CONF.register_opts(haproxy_amphora_opts, group\u003d\u0027haproxy_amphora\u0027)"}],"source_content_type":"text/x-python","patch_set":63,"id":"da20952f_71e9aab6","line":268,"updated":"2015-09-04 07:40:57.000000000","message":"New namespace to declare in octavia/opts.py file","commit_id":"b4d2a1934101ad28b701162eed82d94c0fbcd949"}],"octavia/controller/healthmanager/heartbeat_udp.py":[{"author":{"_account_id":10477,"name":"min wang","email":"swiftwangster@gmail.com","username":"minwang"},"change_message_id":"0732ea0cfeb4a372ae1a6e6b42e28bcd2b311029","unresolved":false,"context_lines":[{"line_number":38,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"class UDPStatusGetter(object):"},{"line_number":42,"context_line":"    def __init__(self):"},{"line_number":43,"context_line":"        self.key \u003d cfg.CONF.health_manager.heartbeat_key"},{"line_number":44,"context_line":"        self.ip \u003d cfg.CONF.health_manager.bind_ip"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a4dcd0f_9fa23c4a","line":41,"updated":"2015-08-05 23:33:04.000000000","message":"if there is docstring for each of the class and method listed in the below, it will be helpful for reading","commit_id":"43af339764e3341c742c3d3e6506fd0aa8575827"}],"octavia/controller/healthmanager/update_health_mixin.py":[{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"fcb407f8afd90121b52914116b02099f4c53eb2b","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"            # if the input amphora is healthy, we update its db info"},{"line_number":82,"context_line":"            self.amphora_health_repo.replace(session, health[\u0027id\u0027],"},{"line_number":83,"context_line":"                                             last_update\u003dfunc.now())"},{"line_number":84,"context_line":"        else:"},{"line_number":85,"context_line":"            LOG.warn(_LW(\u0027Amphora %(id)s health message reports %(found)i \u0027"},{"line_number":86,"context_line":"                         \u0027listeners when %(expected)i expected\u0027),"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_ef1f2506","line":83,"updated":"2015-08-28 17:50:12.000000000","message":"that date needs to come from the UDP listener. You are putting the command on a queue so an amphora might appear healthy because the update got delayed while it is broken.","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"257f88fd82094ee8c6d6d79dae95b735d1c93562","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"            # if the input amphora is healthy, we update its db info"},{"line_number":82,"context_line":"            self.amphora_health_repo.replace(session, health[\u0027id\u0027],"},{"line_number":83,"context_line":"                                             last_update\u003dfunc.now())"},{"line_number":84,"context_line":"        else:"},{"line_number":85,"context_line":"            LOG.warn(_LW(\u0027Amphora %(id)s health message reports %(found)i \u0027"},{"line_number":86,"context_line":"                         \u0027listeners when %(expected)i expected\u0027),"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_18e501db","line":83,"in_reply_to":"da20952f_7d066f1e","updated":"2015-08-28 18:55:33.000000000","message":"You found a portable way to do this. I thought you coulden\u0027t with SQLAlchemy. I also thought we were leaning towards NTP servers. clock skew seems kinda minimul when you consider your defaulting the timeouts \u003e 30secs.\nI\u0027m leaning towards trusting NTP myself as well.","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"ef6fd742c551971a472fb95a346ae9ac9acefda3","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"            # if the input amphora is healthy, we update its db info"},{"line_number":82,"context_line":"            self.amphora_health_repo.replace(session, health[\u0027id\u0027],"},{"line_number":83,"context_line":"                                             last_update\u003dfunc.now())"},{"line_number":84,"context_line":"        else:"},{"line_number":85,"context_line":"            LOG.warn(_LW(\u0027Amphora %(id)s health message reports %(found)i \u0027"},{"line_number":86,"context_line":"                         \u0027listeners when %(expected)i expected\u0027),"}],"source_content_type":"text/x-python","patch_set":57,"id":"da20952f_7d066f1e","line":83,"in_reply_to":"da20952f_ef1f2506","updated":"2015-08-28 18:17:47.000000000","message":"This timestamp needs to be a database time stamp as we are using the database as a \"single point of truth\" for fail over timing.\nThis eliminates fail overs due to clock skew across the controllers, amps, and database.","commit_id":"635c570b1ce330aef2f9cb1ee15f7be88db3d7f9"}],"octavia/db/migration/alembic.ini":[{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"0ac30c2b19f49036148492f25254c50887ffc3bb","unresolved":false,"context_lines":[{"line_number":20,"context_line":"# versions/ directory"},{"line_number":21,"context_line":"# sourceless \u003d false"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"sqlalchemy.url \u003d mysql+pymysql://root:passwd@127.0.0.1:3306/octavia"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"# Logging configuration"}],"source_content_type":"text/x-properties","patch_set":27,"id":"1a4dcd0f_6f9ae715","line":23,"updated":"2015-08-12 23:34:17.000000000","message":"please don\u0027t add that to the patch. Everybody has different pwd/username","commit_id":"109120d4e4d368fbf74ce6918c46eee01b23e895"}],"octavia/db/repositories.py":[{"author":{"_account_id":10477,"name":"min wang","email":"swiftwangster@gmail.com","username":"minwang"},"change_message_id":"0732ea0cfeb4a372ae1a6e6b42e28bcd2b311029","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            session.query(self.model_class).filter_by("},{"line_number":380,"context_line":"                amphora_id\u003damphora_id).update(model_kwargs)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def replace(self, session, amphora_id, **model_kwargs):"},{"line_number":383,"context_line":"        \"\"\"replace or insert amphora into database.\"\"\""},{"line_number":384,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":385,"context_line":"            count \u003d session.query(self.model_class).filter_by("}],"source_content_type":"text/x-python","patch_set":23,"id":"1a4dcd0f_bf061884","line":382,"updated":"2015-08-05 23:33:04.000000000","message":"referring line 359 to 370, we can do the similar thing, combine these two methods into one:update, when three is nothing to update, we create, otherwise we update it, how do you think of this idea?","commit_id":"43af339764e3341c742c3d3e6506fd0aa8575827"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"886b11a63534de4c4edecae9e3934a77c1dbc7ed","unresolved":false,"context_lines":[{"line_number":425,"context_line":""},{"line_number":426,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":427,"context_line":"            amp \u003d None"},{"line_number":428,"context_line":"            # TODO(johnsom) This is evil.  Need a way to do this in sqlalchemy"},{"line_number":429,"context_line":"            if \u0027mysql\u0027 in str(session.bind.dialect):"},{"line_number":430,"context_line":"                amp \u003d (session.query(self.model_class).with_for_update()."},{"line_number":431,"context_line":"                       filter_by(busy\u003dFalse).filter("}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_d5adf29b","line":428,"updated":"2015-08-20 07:52:24.000000000","message":"Verified there is no way to do this generically and have it work in multiple SQL dialects.","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"f903514074fd111ae645608d715ca6e2bd5dbeb3","unresolved":false,"context_lines":[{"line_number":425,"context_line":""},{"line_number":426,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":427,"context_line":"            amp \u003d None"},{"line_number":428,"context_line":"            # TODO(johnsom) This is evil.  Need a way to do this in sqlalchemy"},{"line_number":429,"context_line":"            if \u0027mysql\u0027 in str(session.bind.dialect):"},{"line_number":430,"context_line":"                amp \u003d (session.query(self.model_class).with_for_update()."},{"line_number":431,"context_line":"                       filter_by(busy\u003dFalse).filter("}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_18ce2563","line":428,"in_reply_to":"fa1b9901_d5adf29b","updated":"2015-08-20 16:19:27.000000000","message":"Thank you for looking into this.  I spent hours trying to figure out if I was missing something with sqlalchemy.","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"886b11a63534de4c4edecae9e3934a77c1dbc7ed","unresolved":false,"context_lines":[{"line_number":432,"context_line":"                       self.model_class.last_update \u003c func.date_sub(func.now(),"},{"line_number":433,"context_line":"                                                                    text("},{"line_number":434,"context_line":"                           \u0027interval \u0027 + str(timeout) + \u0027 second\u0027))"},{"line_number":435,"context_line":"                       ).first())"},{"line_number":436,"context_line":"            elif \u0027sqlite\u0027 in str(session.bind.dialect):"},{"line_number":437,"context_line":"                amp \u003d (session.query(self.model_class).with_for_update()."},{"line_number":438,"context_line":"                       filter_by(busy\u003dFalse).filter("}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_354c6ec7","line":435,"updated":"2015-08-20 07:52:24.000000000","message":"More ways to do the exact same thing (but in the end are all still MySQL specific):\n\n filter(Amphora.last_update \u003c func.timestampadd(sqlalchemy.text(\"SECOND\"), -timeout, func.now()))\n\n filter(func.timestampdiff(sqlalchemy.text(\"SECOND\"), Amphora.last_update, func.now()) \u003e timeout)\n\n filter(Amphora.last_update \u003c func.subtime(func.now(), timeout)) # this one is the cleanest\n\nThe problem is that the sqlalchemy.func utility just makes SQL text based on the pattern you provide, and doesn\u0027t actually do anything to help you translate between dialects (with only very specific exceptions -- like func.now() and func.count(), and a few others). For example: \n\n `func.subtime(func.now(), 10)` generates:\n MySQL: \"subtime(NOW(), 10)\"\n SQLite:  \"subtime(CURRENT_TIMESTAMP, 10)\"\n\nIt does pick a different format per dialect for func.now() since it is one of the few generics defined, but subtime() is not a valid function in SQLite so it\u0027s still an error. The same applies to func.date_sub(), so you might as well just do the whole thing as text() for all it matters if you really want to do it on the DB side. :(","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"f903514074fd111ae645608d715ca6e2bd5dbeb3","unresolved":false,"context_lines":[{"line_number":432,"context_line":"                       self.model_class.last_update \u003c func.date_sub(func.now(),"},{"line_number":433,"context_line":"                                                                    text("},{"line_number":434,"context_line":"                           \u0027interval \u0027 + str(timeout) + \u0027 second\u0027))"},{"line_number":435,"context_line":"                       ).first())"},{"line_number":436,"context_line":"            elif \u0027sqlite\u0027 in str(session.bind.dialect):"},{"line_number":437,"context_line":"                amp \u003d (session.query(self.model_class).with_for_update()."},{"line_number":438,"context_line":"                       filter_by(busy\u003dFalse).filter("}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_d8daed16","line":435,"in_reply_to":"fa1b9901_354c6ec7","updated":"2015-08-20 16:19:27.000000000","message":"I have updated my code and tested the \"cleanest\" option (thanks!).\nIt will be in my next patchset.","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"886b11a63534de4c4edecae9e3934a77c1dbc7ed","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            else:"},{"line_number":444,"context_line":"                LOG.critical(_LC(\u0027Unnown database dialect.  Unable to \u0027"},{"line_number":445,"context_line":"                                 \u0027calculate amphora health interval. \u0027"},{"line_number":446,"context_line":"                                 \u0027Unable to failover amphora.\u0027))"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"            if amp is None:"},{"line_number":449,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_a06cba35","line":446,"updated":"2015-08-20 07:52:24.000000000","message":"As a followup though, I don\u0027t think we NEED to do this on the DB side -- you may be underestimating the intelligence of the time translation.\nFor example, this seems to work in my testbed:\n\n filter(datetime.datetime.now() - Amphora.last_update \u003c 10)\n\nThat does the time comparison locally, and seems to translate properly, because I get the expected results back. For the record, I am using a DB that is not on my machine (it is a DBaaS instance, configured to use UTC I think). Trying to do this on the DB side might be solving a non-problem.","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":10850,"name":"German Eichberger","email":"german.eichberger@gmail.com","username":"german"},"change_message_id":"d922111fc0060f2dcb52795f098f1b65e55e70de","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            else:"},{"line_number":444,"context_line":"                LOG.critical(_LC(\u0027Unnown database dialect.  Unable to \u0027"},{"line_number":445,"context_line":"                                 \u0027calculate amphora health interval. \u0027"},{"line_number":446,"context_line":"                                 \u0027Unable to failover amphora.\u0027))"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"            if amp is None:"},{"line_number":449,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_6fd0aec9","line":446,"in_reply_to":"fa1b9901_1c713244","updated":"2015-08-20 18:52:43.000000000","message":"I can\u0027t see us not running NTP as well but I also know that NTP has it\u0027s own issues (that\u0027s why people have alerts in their monitoring systems for time skew). Anyway, if we can be less dependent on NTP for the failover decision that would be better because one single health manager can do a lot of harm if it\u0027s out of sync with time. Do we need to solve that problem now? Probably not since we only aim for devstack...","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8cca6d230cc56e8cae15c20a5966adecbb80808d","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            else:"},{"line_number":444,"context_line":"                LOG.critical(_LC(\u0027Unnown database dialect.  Unable to \u0027"},{"line_number":445,"context_line":"                                 \u0027calculate amphora health interval. \u0027"},{"line_number":446,"context_line":"                                 \u0027Unable to failover amphora.\u0027))"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"            if amp is None:"},{"line_number":449,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_5600d365","line":446,"in_reply_to":"fa1b9901_6fd0aec9","updated":"2015-08-21 04:25:55.000000000","message":"I seriously can\u0027t see a situation where the time skew gets SO large that it\u0027s that harmful, except possibly some sort of NTP misconfiguration that sets one machine ahead by an hour or something really obviously messy like that. I think in that case, we\u0027d want to be hitting one of those thresholds for \"percent of machines to be recycled too high\" and stop operation (we were still planning to implement those thresholds, right?).\n\nAre you saying that for now we don\u0027t try to solve this and we leave it in a MySQL specific dialect, or are you saying we don\u0027t try to solve this and assume the system clocks will be properly synced?","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"a3c3ba425debf214fe944406aa00f78614f1cf41","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            else:"},{"line_number":444,"context_line":"                LOG.critical(_LC(\u0027Unnown database dialect.  Unable to \u0027"},{"line_number":445,"context_line":"                                 \u0027calculate amphora health interval. \u0027"},{"line_number":446,"context_line":"                                 \u0027Unable to failover amphora.\u0027))"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"            if amp is None:"},{"line_number":449,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_1c713244","line":446,"in_reply_to":"fa1b9901_78df213a","updated":"2015-08-20 18:24:33.000000000","message":"Well, I would agree if it were easily possible to do so -- but the tradeoff here is that we essentially have to support every dialect of SQL manually because there just isn\u0027t a dialect agnostic way to do this with the ORM. I am surprised you were already seeing that significant of a skew between devstack and your DB... do you know how many seconds you were off? I am just on my random laptop and using some DBaaS cloud instance, and I am seeing remarkably low skew without even trying, due to NTP I believe. That said, if running NTP really isn\u0027t an option for you (which seems strange to me, but my cloud experience is probably less than yours) we CAN do this... It\u0027s just ugly and painful as all heck.","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":7398,"name":"Carlos Garza","email":"carlos.garza@rackspace.com","username":"crc32"},"change_message_id":"d2a13befbdbb51e12040e4a18e7fe77234a0d67a","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            else:"},{"line_number":444,"context_line":"                LOG.critical(_LC(\u0027Unnown database dialect.  Unable to \u0027"},{"line_number":445,"context_line":"                                 \u0027calculate amphora health interval. \u0027"},{"line_number":446,"context_line":"                                 \u0027Unable to failover amphora.\u0027))"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"            if amp is None:"},{"line_number":449,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_78df213a","line":446,"in_reply_to":"fa1b9901_9b71eb78","updated":"2015-08-20 16:23:07.000000000","message":"I agree. Unless we are open to using a close NTP server we should just use the time of the MySQL server. Does HP have an issue with a NTP server in their environment?","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"f903514074fd111ae645608d715ca6e2bd5dbeb3","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            else:"},{"line_number":444,"context_line":"                LOG.critical(_LC(\u0027Unnown database dialect.  Unable to \u0027"},{"line_number":445,"context_line":"                                 \u0027calculate amphora health interval. \u0027"},{"line_number":446,"context_line":"                                 \u0027Unable to failover amphora.\u0027))"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"            if amp is None:"},{"line_number":449,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_9892354b","line":446,"in_reply_to":"fa1b9901_9b71eb78","updated":"2015-08-20 16:19:27.000000000","message":"I started looking at this issue after having an issue with skew between the DB\u0027s view of time and the devstack host.\nWe do have deployments in isolated environments where access to ntp time sources are not always available.  They don\u0027t like it when we say, well you can buy a satellite ntp time source....\nSo, personally I think having the DB be the single point of time truth for all of the controllers is worth it.","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"1f4c495b33bbef1f0d02b2e32a3b9e5da3d202fd","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            else:"},{"line_number":444,"context_line":"                LOG.critical(_LC(\u0027Unnown database dialect.  Unable to \u0027"},{"line_number":445,"context_line":"                                 \u0027calculate amphora health interval. \u0027"},{"line_number":446,"context_line":"                                 \u0027Unable to failover amphora.\u0027))"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"            if amp is None:"},{"line_number":449,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa1b9901_9b71eb78","line":446,"in_reply_to":"fa1b9901_a06cba35","updated":"2015-08-20 07:56:37.000000000","message":"I forgot to mention: the other concern you had was skew, I believe? Like either between the DB server and the controller, or between multiple controllers? I believe that any sane setup is going to be using ntp to keep server times in sync, so worst case I\u0027d imagine a small subsecond skew, and I really hope our thresholds for failover aren\u0027t that tight...","commit_id":"667ab258ae3f1e9804280e2ca455cec4f7c15be9"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"6474315a234f1571d99ded9b108f8ac98998197f","unresolved":false,"context_lines":[{"line_number":461,"context_line":"            if \u0027mysql\u0027 in str(session.bind.dialect):"},{"line_number":462,"context_line":"                amp \u003d (session.query(self.model_class).with_for_update()."},{"line_number":463,"context_line":"                       filter_by(busy\u003dFalse).filter("},{"line_number":464,"context_line":"                       self.model_class.last_update \u003c func.subtime(func.now(),"},{"line_number":465,"context_line":"                                                                   timeout)"},{"line_number":466,"context_line":"                       ).first())"},{"line_number":467,"context_line":"            elif \u0027sqlite\u0027 in str(session.bind.dialect):"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa1b9901_afb51832","line":464,"updated":"2015-08-22 05:51:10.000000000","message":"I stand by my previously stated dislike of doing things in this very non-portable way... But, if we\u0027re dead-set on doing it this way, it should at least be documented somewhere with HIGH VISIBILITY that there is code in our project that limits DB options to MySQL or SQLite, and that if you want to use it with a different DB, you need to patch this file to include the time calculations for that additional dialect.\n\nSo far the only DB I can find that this will work with is MySQL -- the note that this should work with other modern databases is a bit disingenuous, since it is not valid PL/SQL, T-SQL, or whatever Postgres calls their dialect.","commit_id":"088f43ebfad1d0d485934b7d9bf1e5b1cde00fe7"}]}
