)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20466,"name":"Tin Lam","email":"tin@lam.wtf","username":"tinlam"},"change_message_id":"f8c6bba6d9f4e7d59e0ca289dcb59628d7271c01","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Gupta, Sangeet (sg774j) \u003csg774j@att.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2020-07-16 20:36:51 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[maraidb] Modified start.py script."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Added check to see if the file is empty before trying to read it."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bf51134e_78e461e1","line":7,"range":{"start_line":7,"start_character":1,"end_line":7,"end_character":8},"updated":"2020-07-16 21:59:45.000000000","message":"mariadb","commit_id":"fdf3c6f00b84d2d8c285cd963e5e8c1318d0d118"},{"author":{"_account_id":24780,"name":"Sangeet Gupta","email":"sg774j@att.com","username":"sgupta"},"change_message_id":"e3c83647804142dfac360e5deb796aa4414bbbcc","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Gupta, Sangeet (sg774j) \u003csg774j@att.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2020-07-16 20:36:51 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[maraidb] Modified start.py script."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Added check to see if the file is empty before trying to read it."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bf51134e_382829ed","line":7,"range":{"start_line":7,"start_character":1,"end_line":7,"end_character":8},"in_reply_to":"bf51134e_78e461e1","updated":"2020-07-16 22:03:10.000000000","message":"Done","commit_id":"fdf3c6f00b84d2d8c285cd963e5e8c1318d0d118"}],"mariadb/templates/bin/_start.py.tpl":[{"author":{"_account_id":20466,"name":"Tin Lam","email":"tin@lam.wtf","username":"tinlam"},"change_message_id":"f8c6bba6d9f4e7d59e0ca289dcb59628d7271c01","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    if os.path.isfile(mysqld_pidfile_path):"},{"line_number":185,"context_line":"        logger.info("},{"line_number":186,"context_line":"            \"Previous pid file found for mysqld, attempting to shut it down\")"},{"line_number":187,"context_line":"        if os.stat(mysqld_pidfile_path).st_size !\u003d 0:"},{"line_number":188,"context_line":"            with open(mysqld_pidfile_path, \"r\") as mysqld_pidfile:"},{"line_number":189,"context_line":"                mysqld_pid \u003d int(mysqld_pidfile.readlines()[0].rstrip(\u0027\\n\u0027))"},{"line_number":190,"context_line":"            if is_pid_running(mysqld_pid):"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"bf51134e_38dae91c","line":187,"range":{"start_line":187,"start_character":7,"end_line":187,"end_character":53},"updated":"2020-07-16 21:59:45.000000000","message":"would this be cleaner if we move the check empty file check before the if-block starting on L184","commit_id":"fdf3c6f00b84d2d8c285cd963e5e8c1318d0d118"},{"author":{"_account_id":24780,"name":"Sangeet Gupta","email":"sg774j@att.com","username":"sgupta"},"change_message_id":"e3c83647804142dfac360e5deb796aa4414bbbcc","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    if os.path.isfile(mysqld_pidfile_path):"},{"line_number":185,"context_line":"        logger.info("},{"line_number":186,"context_line":"            \"Previous pid file found for mysqld, attempting to shut it down\")"},{"line_number":187,"context_line":"        if os.stat(mysqld_pidfile_path).st_size !\u003d 0:"},{"line_number":188,"context_line":"            with open(mysqld_pidfile_path, \"r\") as mysqld_pidfile:"},{"line_number":189,"context_line":"                mysqld_pid \u003d int(mysqld_pidfile.readlines()[0].rstrip(\u0027\\n\u0027))"},{"line_number":190,"context_line":"            if is_pid_running(mysqld_pid):"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"bf51134e_98f335a0","line":187,"range":{"start_line":187,"start_character":7,"end_line":187,"end_character":53},"in_reply_to":"bf51134e_38dae91c","updated":"2020-07-16 22:03:10.000000000","message":"L184 is checking if the file exist. So we can not move it before that line. Once we ensured file is present, then check if it is empty.","commit_id":"fdf3c6f00b84d2d8c285cd963e5e8c1318d0d118"},{"author":{"_account_id":8898,"name":"Chris Wedgwood","email":"cw@f00f.org","username":"anticw"},"change_message_id":"e1fcfb8ab970db7094c73ee6065ec80440bc35cb","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        else:"},{"line_number":182,"context_line":"            return False"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    if os.path.isfile(mysqld_pidfile_path):"},{"line_number":185,"context_line":"        logger.info("},{"line_number":186,"context_line":"            \"Previous pid file found for mysqld, attempting to shut it down\")"},{"line_number":187,"context_line":"        if os.stat(mysqld_pidfile_path).st_size !\u003d 0:"}],"source_content_type":"text/x-smarty","patch_set":2,"id":"bf51134e_c70ae825","line":184,"range":{"start_line":184,"start_character":38,"end_line":184,"end_character":43},"updated":"2020-07-17 08:54:26.000000000","message":"\u0026\u0026 os.stat(...) !\u003d 0\n\n?","commit_id":"4963807aa4558489f69b2f6a977d40d28b9ccb10"},{"author":{"_account_id":24780,"name":"Sangeet Gupta","email":"sg774j@att.com","username":"sgupta"},"change_message_id":"c13b4bc5658ff74d0e13418b615f88d1e0b1f047","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        else:"},{"line_number":182,"context_line":"            return False"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    if os.path.isfile(mysqld_pidfile_path):"},{"line_number":185,"context_line":"        logger.info("},{"line_number":186,"context_line":"            \"Previous pid file found for mysqld, attempting to shut it down\")"},{"line_number":187,"context_line":"        if os.stat(mysqld_pidfile_path).st_size !\u003d 0:"}],"source_content_type":"text/x-smarty","patch_set":2,"id":"bf51134e_8db927ee","line":184,"range":{"start_line":184,"start_character":38,"end_line":184,"end_character":43},"in_reply_to":"bf51134e_b8ab8e1c","updated":"2020-07-17 19:30:59.000000000","message":"Yes I have to split for logging purpose. Made the changes","commit_id":"4963807aa4558489f69b2f6a977d40d28b9ccb10"},{"author":{"_account_id":8863,"name":"Andrii Ostapenko","email":"anost1986@gmail.com","username":"aostapenko"},"change_message_id":"e80b94d7af4754154a79172c14dd7b18785a2a93","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        else:"},{"line_number":182,"context_line":"            return False"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    if os.path.isfile(mysqld_pidfile_path):"},{"line_number":185,"context_line":"        logger.info("},{"line_number":186,"context_line":"            \"Previous pid file found for mysqld, attempting to shut it down\")"},{"line_number":187,"context_line":"        if os.stat(mysqld_pidfile_path).st_size !\u003d 0:"}],"source_content_type":"text/x-smarty","patch_set":2,"id":"bf51134e_b8ab8e1c","line":184,"range":{"start_line":184,"start_character":38,"end_line":184,"end_character":43},"in_reply_to":"bf51134e_c70ae825","updated":"2020-07-17 14:25:17.000000000","message":"agreed. though if you want to have it separate because of logging there\u0027s no need for this extra indentation anyway - it becomes ugly already and will benefit from refactoring. If i don\u0027t miss anything all \u0027if\u0027 seem to be easy to rewrite inverting  conditions and using \u0027return\u0027 w/o \u0027else\u0027 and then use no indentation for original \u0027if\u0027. Like:\nif not os.path.isfile(mysqld_pidfile_path):\n    logger.debug(\"No previous pid file found for mysqld\")\n    return\nlogger.info(\"Previous pid file found for mysqld, attempting to shut it down\")\nif os.stat(mysqld_pidfile_path).st_size \u003d\u003d 0:\n    logger.info(\"{0} file is empty, going to remove it\".format(mysqld_pidfile_path))\n    os.remove(mysqld_pidfile_path)\n    return\n...\n\nPython code is a poem :)","commit_id":"4963807aa4558489f69b2f6a977d40d28b9ccb10"},{"author":{"_account_id":22636,"name":"Cliff Parsons","email":"cliffhparsons@aol.com","username":"cliffparsons"},"change_message_id":"c03c86bfde3e0612cfc8ad71e50218db76470505","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    if not os.path.isfile(mysqld_pidfile_path):"},{"line_number":185,"context_line":"        logger.debug(\"No previous pid file found for mysqld\")"},{"line_number":186,"context_line":"        retrun"},{"line_number":187,"context_line":"    logger.info(\"Previous pid file found for mysqld, attempting to shut it down\")"},{"line_number":188,"context_line":"    if os.stat(mysqld_pidfile_path).st_size \u003d\u003d 0:"},{"line_number":189,"context_line":"        logger.info("}],"source_content_type":"text/x-smarty","patch_set":3,"id":"bf51134e_2dd57be6","line":186,"range":{"start_line":186,"start_character":0,"end_line":186,"end_character":14},"updated":"2020-07-17 19:42:25.000000000","message":"return misspelled","commit_id":"fc9ac5be24483477f43c10696a88af4978dd04f2"},{"author":{"_account_id":22636,"name":"Cliff Parsons","email":"cliffhparsons@aol.com","username":"cliffparsons"},"change_message_id":"c03c86bfde3e0612cfc8ad71e50218db76470505","unresolved":false,"context_lines":[{"line_number":189,"context_line":"        logger.info("},{"line_number":190,"context_line":"            \"{0} file is empty, removing it\".format(mysqld_pidfile_path))"},{"line_number":191,"context_line":"        os.remove(mysqld_pidfile_path)"},{"line_number":192,"context_line":"        retrun"},{"line_number":193,"context_line":"    with open(mysqld_pidfile_path, \"r\") as mysqld_pidfile:"},{"line_number":194,"context_line":"        mysqld_pid \u003d int(mysqld_pidfile.readlines()[0].rstrip(\u0027\\n\u0027))"},{"line_number":195,"context_line":"    if not is_pid_running(mysqld_pid):"}],"source_content_type":"text/x-smarty","patch_set":3,"id":"bf51134e_6d081391","line":192,"range":{"start_line":192,"start_character":0,"end_line":192,"end_character":14},"updated":"2020-07-17 19:42:25.000000000","message":"misspelled","commit_id":"fc9ac5be24483477f43c10696a88af4978dd04f2"},{"author":{"_account_id":22636,"name":"Cliff Parsons","email":"cliffhparsons@aol.com","username":"cliffparsons"},"change_message_id":"c03c86bfde3e0612cfc8ad71e50218db76470505","unresolved":false,"context_lines":[{"line_number":197,"context_line":"            \"Mysqld was not running with pid {0}, going to remove stale \""},{"line_number":198,"context_line":"            \"file\".format(mysqld_pid))"},{"line_number":199,"context_line":"        os.remove(mysqld_pidfile_path)"},{"line_number":200,"context_line":"        retrun"},{"line_number":201,"context_line":"    if not is_pid_mysqld(mysqld_pid):"},{"line_number":202,"context_line":"        logger.error("},{"line_number":203,"context_line":"            \"pidfile process is not mysqld, removing pidfile and panic\")"}],"source_content_type":"text/x-smarty","patch_set":3,"id":"bf51134e_cdfddf6f","line":200,"range":{"start_line":200,"start_character":0,"end_line":200,"end_character":14},"updated":"2020-07-17 19:42:25.000000000","message":"again","commit_id":"fc9ac5be24483477f43c10696a88af4978dd04f2"}]}
