)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e380f40fb60f15a79ed8b02d054e73b8e6cc8536","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"c25df70d_457f5e1c","updated":"2025-08-08 21:34:44.000000000","message":"We should not squash this - it has some implementation issues among other things.\n\nHowever the instrumentation in `container.replicator` is probably a nod to the right direction of where we want to get in the final analysis.","commit_id":"0eaf28743b0fef4df4002f6082632cc113a8c212"}],"swift/common/db_replicator.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e380f40fb60f15a79ed8b02d054e73b8e6cc8536","unresolved":true,"context_lines":[{"line_number":223,"context_line":"            # there\u0027s some trixy cache population in ContainerBroker to fetch"},{"line_number":224,"context_line":"            # the broker.path property that we explicitly want to avoid for"},{"line_number":225,"context_line":"            # debug messages when not running debug logging."},{"line_number":226,"context_line":"            msg, args \u003d self._format_broker_log(broker, msg, *args)"},{"line_number":227,"context_line":"        self.logger.log(level, msg, *args, **kwargs)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def debug(self, broker, msg, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"4b7548a3_7e01ec21","line":226,"updated":"2025-08-08 21:34:44.000000000","message":"so I\u0027ve actually sort of come around to the:\n\n```\nif args:\n    msg \u003d msg % args\nself.logger.log(\u0027%s, path: %s, db: %s\u0027, msg, db_path, db_file)\n```\n\n... approach.  It *seems* like it\u0027s doing work that the stdlib log module could do but it elegantly handles a few edge cases.  I might swap out `_format_broker_log` back to `_get_broker_args` and do the inline msg-formatting and see what tests break.","commit_id":"574a1838cd4bcecceced91dcb943434c02b8c7c5"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e380f40fb60f15a79ed8b02d054e73b8e6cc8536","unresolved":true,"context_lines":[{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def exception(self, broker, msg, *args, **kwargs):"},{"line_number":242,"context_line":"        kwargs[\u0027exc_info\u0027] \u003d True"},{"line_number":243,"context_line":"        self._log(logging.ERROR, broker, msg, *args, **kwargs)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"class Replicator(Daemon, BrokerLogger):"}],"source_content_type":"text/x-python","patch_set":1,"id":"26f78cd9_edd0bfdb","line":243,"updated":"2025-08-08 21:34:44.000000000","message":"this is no good!  we need to *actually* call `SwiftLogAdapter.exception` or our socket.error\u0027s will *actually* print stack!!","commit_id":"574a1838cd4bcecceced91dcb943434c02b8c7c5"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e380f40fb60f15a79ed8b02d054e73b8e6cc8536","unresolved":true,"context_lines":[{"line_number":620,"context_line":"        :return success: returns False if deletion of the database was"},{"line_number":621,"context_line":"            attempted but unsuccessful, otherwise returns True."},{"line_number":622,"context_line":"        \"\"\""},{"line_number":623,"context_line":"        log_template \u003d \u0027Not deleting db %s\u0027"},{"line_number":624,"context_line":"        max_row_delta \u003d broker.get_max_row() - orig_info[\u0027max_row\u0027]"},{"line_number":625,"context_line":"        if max_row_delta \u003c 0:"},{"line_number":626,"context_line":"            reason \u003d \u0027negative max_row_delta: %s\u0027 % max_row_delta"}],"source_content_type":"text/x-python","patch_set":1,"id":"8e4193f1_ca6e03bb","line":623,"updated":"2025-08-08 21:34:44.000000000","message":"I think the parent change fixes this.","commit_id":"574a1838cd4bcecceced91dcb943434c02b8c7c5"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e380f40fb60f15a79ed8b02d054e73b8e6cc8536","unresolved":true,"context_lines":[{"line_number":932,"context_line":"                sleep(self.interval - elapsed)"},{"line_number":933,"context_line":""},{"line_number":934,"context_line":""},{"line_number":935,"context_line":"class ReplicatorRpc(BrokerLogger):"},{"line_number":936,"context_line":"    \"\"\"Handle Replication RPC calls.  TODO(redbo): document please :)\"\"\""},{"line_number":937,"context_line":""},{"line_number":938,"context_line":"    def __init__(self, root, datadir, broker_class, mount_check\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":1,"id":"2d267433_f870a275","line":935,"updated":"2025-08-08 21:34:44.000000000","message":"this is just so that I could instrument the `check_merge_own_shard_range` function in `container.replicator` which seemed valuable.\n\nI tried using a MixIn but ultimately decided a common parent of Replicator/ReplicatorRpc was the \"most obvious\"\n\n... the annoying part was that ContainerReplicator/ContainerReplicatorRpc share no other common parent - so I couldn\u0027t make `check_merge_own_shard_range` a *function* so instead the call it with `check_merge_own_shard_range(self, ...)` which looks like of like \"why isn\u0027t this function a method\"\n\n... but making two classes with a multi-layer inheritance share a dimond inheritance BaseClass just to make a single function a method seemed wonky too.\n\nOther option might be to avoid the whole mess and leave `check_merge_own_shard_range` un-instrumented OR alternatively make both Replicator/ReplicatorRpc have a `self.logger \u003d BrokerLogger(logger)` (composition over inheritance anyone?)\n\n... then either BrokerLogger can `if isisntance(msg, DatabaseBroker)` - but it\u0027ll also have to proxy increment and stuff.","commit_id":"574a1838cd4bcecceced91dcb943434c02b8c7c5"}],"test/unit/common/test_db_replicator.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e380f40fb60f15a79ed8b02d054e73b8e6cc8536","unresolved":true,"context_lines":[{"line_number":2454,"context_line":"        do_test(\u0027debug\u0027)"},{"line_number":2455,"context_line":"        do_test(\u0027info\u0027)"},{"line_number":2456,"context_line":"        do_test(\u0027warning\u0027)"},{"line_number":2457,"context_line":"        do_test(\u0027error\u0027)"},{"line_number":2458,"context_line":""},{"line_number":2459,"context_line":""},{"line_number":2460,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"b2a74034_3269c1cf","line":2457,"updated":"2025-08-08 21:34:44.000000000","message":"this should have tests for using named formatting dict \n\ni.e.\n\n```\nctx \u003d {\u0027user\u0027: user_id}\nbroker_logger.info(broker, \u0027important %(user)s\u0027, ctx)\n```","commit_id":"574a1838cd4bcecceced91dcb943434c02b8c7c5"}],"test/unit/container/test_backend.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e380f40fb60f15a79ed8b02d054e73b8e6cc8536","unresolved":true,"context_lines":[{"line_number":5837,"context_line":"        # cached properties have not been set..."},{"line_number":5838,"context_line":"        self.assertIsNone(broker.account)"},{"line_number":5839,"context_line":"        self.assertIsNone(broker.container)"},{"line_number":5840,"context_line":"        self.assertFalse(broker_logger.logger.all_log_lines())"},{"line_number":5841,"context_line":""},{"line_number":5842,"context_line":""},{"line_number":5843,"context_line":"class TestCommonContainerBroker(test_db.TestExampleBroker):"}],"source_content_type":"text/x-python","patch_set":1,"id":"8d0f07df_3e139cca","line":5840,"updated":"2025-08-08 21:34:44.000000000","message":"this test came from `test_sharder` - it\u0027s a good test.  I think it makes more sense here than over in `test_db_replicator` because despite testing an *interaction* with `BrokerLogger` the caching behavior is actually part of the `ContainerBroker`\n\n... so either `test_db_replicator` grows a dependency on `ContainerBroker` or we assert the behavior of `BrokerLogger` that we want (don\u0027t call \"get_broker_args\" if not `isEnabledFor`) based on how we observe it iterating with a real account/container caching `ContainerBroker`.","commit_id":"574a1838cd4bcecceced91dcb943434c02b8c7c5"}],"test/unit/container/test_sharder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e380f40fb60f15a79ed8b02d054e73b8e6cc8536","unresolved":true,"context_lines":[{"line_number":5521,"context_line":"        self.assertFalse(sharder.logger.get_lines_for_level(\u0027warning\u0027))"},{"line_number":5522,"context_line":"        self.assertEqual(set("},{"line_number":5523,"context_line":"            \u0027Failed to put shard ranges to %s a/c: FakeStatus Error, \u0027"},{"line_number":5524,"context_line":"            \u0027path: a/c, db: %s: \u0027 % (host, broker.db_file) for host in hosts),"},{"line_number":5525,"context_line":"            set(sharder.logger.get_lines_for_level(\u0027error\u0027)))"},{"line_number":5526,"context_line":"        res, sharder, _ \u003d do_test(replicas, eventlet.Timeout(), Exception)"},{"line_number":5527,"context_line":"        self.assertFalse(res)"}],"source_content_type":"text/x-python","patch_set":1,"id":"0e14b84e_e46a052d","side":"PARENT","line":5524,"updated":"2025-08-08 21:34:44.000000000","message":"Originally I thought this was an existing test bug:\n\n878636: sharder: fix host logged when send_shard_ranges fails | https://review.opendev.org/c/openstack/swift/+/878636\n\n... but it turns out it\u0027s asserting we\u0027re getting `SwiftLogAdapter.exception`\u0027s custom formatting.","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"}]}
