)]}'
{"swift/common/utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f8c024603c9f4c3d458a89bba1f7720fba98b3db","unresolved":false,"context_lines":[{"line_number":5822,"context_line":"    return sorted(results)"},{"line_number":5823,"context_line":""},{"line_number":5824,"context_line":""},{"line_number":5825,"context_line":"def systemd_notify():"},{"line_number":5826,"context_line":"    msg \u003d b\u0027READY\u003d1\u0027"},{"line_number":5827,"context_line":"    notify_socket \u003d os.getenv(\u0027NOTIFY_SOCKET\u0027)"},{"line_number":5828,"context_line":"    if notify_socket:"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_3bdb80ed","line":5825,"updated":"2020-03-28 13:22:14.000000000","message":"docstring please","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"6c4e957a827e2de7cca0ff9e675f205ad1433d58","unresolved":false,"context_lines":[{"line_number":5822,"context_line":"    return sorted(results)"},{"line_number":5823,"context_line":""},{"line_number":5824,"context_line":""},{"line_number":5825,"context_line":"def systemd_notify():"},{"line_number":5826,"context_line":"    msg \u003d b\u0027READY\u003d1\u0027"},{"line_number":5827,"context_line":"    notify_socket \u003d os.getenv(\u0027NOTIFY_SOCKET\u0027)"},{"line_number":5828,"context_line":"    if notify_socket:"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_f1a2d8fb","line":5825,"in_reply_to":"df33271e_3bdb80ed","updated":"2020-03-28 22:25:41.000000000","message":"Done","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"16b60ec6d1ebdf8b0318e0cb83a85ef814546b22","unresolved":false,"context_lines":[{"line_number":5824,"context_line":""},{"line_number":5825,"context_line":"def systemd_notify():"},{"line_number":5826,"context_line":"    msg \u003d b\u0027READY\u003d1\u0027"},{"line_number":5827,"context_line":"    notify_socket \u003d os.getenv(\u0027NOTIFY_SOCKET\u0027)"},{"line_number":5828,"context_line":"    if notify_socket:"},{"line_number":5829,"context_line":"        if notify_socket.startswith(\u0027@\u0027):"},{"line_number":5830,"context_line":"            # abstract namespace socket"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_85934bfa","line":5827,"updated":"2020-03-28 05:25:14.000000000","message":"Where does this come from? From the systemd unit? Is it a convention in systemd world?","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"6c4e957a827e2de7cca0ff9e675f205ad1433d58","unresolved":false,"context_lines":[{"line_number":5824,"context_line":""},{"line_number":5825,"context_line":"def systemd_notify():"},{"line_number":5826,"context_line":"    msg \u003d b\u0027READY\u003d1\u0027"},{"line_number":5827,"context_line":"    notify_socket \u003d os.getenv(\u0027NOTIFY_SOCKET\u0027)"},{"line_number":5828,"context_line":"    if notify_socket:"},{"line_number":5829,"context_line":"        if notify_socket.startswith(\u0027@\u0027):"},{"line_number":5830,"context_line":"            # abstract namespace socket"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_d1a7d40a","line":5827,"in_reply_to":"df33271e_85934bfa","updated":"2020-03-28 22:25:41.000000000","message":"I added some information in the docstring with a link to the offical systemd documentation: https://www.freedesktop.org/software/systemd/man/sd_notify.html","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"16b60ec6d1ebdf8b0318e0cb83a85ef814546b22","unresolved":false,"context_lines":[{"line_number":5836,"context_line":"                sock.sendall(msg)"},{"line_number":5837,"context_line":"                del os.environ[\u0027NOTIFY_SOCKET\u0027]"},{"line_number":5838,"context_line":"            except EnvironmentError:"},{"line_number":5839,"context_line":"                logging.debug(\"Systemd notification failed\", exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_e5a2174b","line":5839,"updated":"2020-03-28 05:25:14.000000000","message":"Does this actually work? Last time I tried this (involuntarily: the keystoneauth did it), the log message was silently dropped within the Python logging framework. Something in the way we log requires us to use loggers that our get_logger() produces.","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"6c4e957a827e2de7cca0ff9e675f205ad1433d58","unresolved":false,"context_lines":[{"line_number":5836,"context_line":"                sock.sendall(msg)"},{"line_number":5837,"context_line":"                del os.environ[\u0027NOTIFY_SOCKET\u0027]"},{"line_number":5838,"context_line":"            except EnvironmentError:"},{"line_number":5839,"context_line":"                logging.debug(\"Systemd notification failed\", exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_11adbce8","line":5839,"in_reply_to":"df33271e_e5a2174b","updated":"2020-03-28 22:25:41.000000000","message":"Right. I followed Clay\u0027s of passing the logger as an argument.","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"125a8f3d5efbe3aa9315e3e9a8528873985527f7","unresolved":false,"context_lines":[{"line_number":5837,"context_line":"    if notify_socket:"},{"line_number":5838,"context_line":"        if notify_socket.startswith(\u0027@\u0027):"},{"line_number":5839,"context_line":"            # abstract namespace socket"},{"line_number":5840,"context_line":"            notify_socket \u003d \u0027\\0%s\u0027 % notify_socket[1:]"},{"line_number":5841,"context_line":"        sock \u003d socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)"},{"line_number":5842,"context_line":"        with closing(sock):"},{"line_number":5843,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_9e61be08","line":5840,"range":{"start_line":5840,"start_character":29,"end_line":5840,"end_character":31},"updated":"2020-03-30 20:46:57.000000000","message":"Oh hey, looks like we weren\u0027t the only ones crazy enough to create some special, reserved namespace by using null bytes :D","commit_id":"061f89e4c81941df409d0cc02cff7d91db72e4df"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4f7a17c5d70a4d1b5991afe181354cafbc698576","unresolved":false,"context_lines":[{"line_number":5843,"context_line":"            try:"},{"line_number":5844,"context_line":"                sock.connect(notify_socket)"},{"line_number":5845,"context_line":"                sock.sendall(msg)"},{"line_number":5846,"context_line":"                del os.environ[\u0027NOTIFY_SOCKET\u0027]"},{"line_number":5847,"context_line":"            except EnvironmentError:"},{"line_number":5848,"context_line":"                if logger:"},{"line_number":5849,"context_line":"                    logger.debug(\"Systemd notification failed\", exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df33271e_dce5dc39","line":5846,"updated":"2020-04-01 15:50:37.000000000","message":"Right; so this will ensure that we only send READY\u003d1 once, even if we use SIGUSR1 to do a reload... though the linked docs make me think it\u0027d be nice to support sending RELOADING\u003d1 and STOPPING\u003d1 when appropriate.\n\n*shrug* Follow-up patch, when we can.","commit_id":"d361e5febfbf516e8eb38871ea32dca36d686dcd"}],"swift/common/wsgi.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f8c024603c9f4c3d458a89bba1f7720fba98b3db","unresolved":false,"context_lines":[{"line_number":1168,"context_line":"        logger.error(error_msg)"},{"line_number":1169,"context_line":"        print(error_msg)"},{"line_number":1170,"context_line":"        return 1"},{"line_number":1171,"context_line":"    systemd_notify()"},{"line_number":1172,"context_line":""},{"line_number":1173,"context_line":"    # Do some daemonization process hygene before we fork any children or run a"},{"line_number":1174,"context_line":"    # server without forking."}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_1bd67cc4","line":1171,"updated":"2020-03-28 13:22:14.000000000","message":"let\u0027s pass in our logger","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"6c4e957a827e2de7cca0ff9e675f205ad1433d58","unresolved":false,"context_lines":[{"line_number":1168,"context_line":"        logger.error(error_msg)"},{"line_number":1169,"context_line":"        print(error_msg)"},{"line_number":1170,"context_line":"        return 1"},{"line_number":1171,"context_line":"    systemd_notify()"},{"line_number":1172,"context_line":""},{"line_number":1173,"context_line":"    # Do some daemonization process hygene before we fork any children or run a"},{"line_number":1174,"context_line":"    # server without forking."}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_71b6c840","line":1171,"in_reply_to":"df33271e_1bd67cc4","updated":"2020-03-28 22:25:41.000000000","message":"Done","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"125a8f3d5efbe3aa9315e3e9a8528873985527f7","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"    clean_up_daemon_hygiene()"},{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"    # Redirect errors to logger and close stdio. Do this *after* binding ports;"},{"line_number":1178,"context_line":"    # we use this to signal that the service is ready to accept connections."},{"line_number":1179,"context_line":"    capture_stdio(logger)"},{"line_number":1180,"context_line":""},{"line_number":1181,"context_line":"    # If necessary, signal an old copy of us that it\u0027s okay to shutdown its"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_9e26decd","line":1178,"range":{"start_line":1178,"start_character":6,"end_line":1178,"end_character":75},"updated":"2020-03-30 20:46:57.000000000","message":"I would\u0027ve expected it more around here -- should we maybe hold off on notifying until after clean_up_daemon_hygiene()?","commit_id":"061f89e4c81941df409d0cc02cff7d91db72e4df"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"5147e232defdb2879c190318d9899c0f2816845f","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"    clean_up_daemon_hygiene()"},{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"    # Redirect errors to logger and close stdio. Do this *after* binding ports;"},{"line_number":1178,"context_line":"    # we use this to signal that the service is ready to accept connections."},{"line_number":1179,"context_line":"    capture_stdio(logger)"},{"line_number":1180,"context_line":""},{"line_number":1181,"context_line":"    # If necessary, signal an old copy of us that it\u0027s okay to shutdown its"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_d53e6a89","line":1178,"range":{"start_line":1178,"start_character":6,"end_line":1178,"end_character":75},"in_reply_to":"df33271e_9e26decd","updated":"2020-03-31 19:23:45.000000000","message":"You\u0027re right. It doesn\u0027t change much to the logic, but it makes more sense. I moved it after the \"signal an old copy\" logic.","commit_id":"061f89e4c81941df409d0cc02cff7d91db72e4df"}],"test/unit/common/test_utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f8c024603c9f4c3d458a89bba1f7720fba98b3db","unresolved":false,"context_lines":[{"line_number":4400,"context_line":"            utils.systemd_notify()"},{"line_number":4401,"context_line":"            m_socket.assert_called_once_with(socket.AF_UNIX, socket.SOCK_DGRAM)"},{"line_number":4402,"context_line":"            m_sock.connect.assert_called_once_with(\u0027\\0foobar\u0027)"},{"line_number":4403,"context_line":"            m_sock.sendall.assert_called_once_with(b\u0027READY\u003d1\u0027)"},{"line_number":4404,"context_line":""},{"line_number":4405,"context_line":""},{"line_number":4406,"context_line":"class ResellerConfReader(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_7be508a8","line":4403,"updated":"2020-03-28 13:22:14.000000000","message":"this is an ok unittest, but it doesn\u0027t really prove anything \"works\"","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"de45096df0c9d2c6997687b9db7bd1d010d562ec","unresolved":false,"context_lines":[{"line_number":4400,"context_line":"            utils.systemd_notify()"},{"line_number":4401,"context_line":"            m_socket.assert_called_once_with(socket.AF_UNIX, socket.SOCK_DGRAM)"},{"line_number":4402,"context_line":"            m_sock.connect.assert_called_once_with(\u0027\\0foobar\u0027)"},{"line_number":4403,"context_line":"            m_sock.sendall.assert_called_once_with(b\u0027READY\u003d1\u0027)"},{"line_number":4404,"context_line":""},{"line_number":4405,"context_line":""},{"line_number":4406,"context_line":"class ResellerConfReader(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_d1f514ef","line":4403,"in_reply_to":"df33271e_7be508a8","updated":"2020-03-28 22:32:54.000000000","message":"Done. Added a real socket in the tests","commit_id":"202161edecba4767168f0feb22f25e40a0e034f6"}]}
