)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"647ea5bd69314e2cea4b6b0766d7e9b97f7405ad","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"0a8c99d4_30d189d8","updated":"2026-01-07 12:17:19.000000000","message":"I like the constructor not applying jitter as a side-effect from the point of view of callers, but I don\u0027t like that many tests use the constructor to create a timestamp (rather than Timestamp.now()) and will therefore be testing without jitter, which is unrealistic.","commit_id":"95b84a6f41518b8e417d09f43edf1c44558a8924"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"95c0616558aa222b65b8bc55cc52d500546f4bbd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"f5ac81c7_b1342681","updated":"2026-01-07 18:29:03.000000000","message":"if we make with_jitter\u003dFalse then we ought to fix a LOT of tests that do something like ``ts \u003d Timestamp(1)`` to instead do ``ts \u003d Timestamp(1, with_jitter\u003dTrue)``","commit_id":"44d093c61c4da005806e8293cdb8a6d1b5172740"}],"swift/common/utils/timestamp.py":[{"author":{"_account_id":34930,"name":"Jianjian Huo","email":"jhuo@nvidia.com","username":"jhuo"},"change_message_id":"0587da43dbe239795d99f33fc2442939af121cfc","unresolved":true,"context_lines":[{"line_number":386,"context_line":"        Returns an instance of a Timestamp at the current time plus random"},{"line_number":387,"context_line":"         jitter."},{"line_number":388,"context_line":"        \"\"\""},{"line_number":389,"context_line":"        return cls(time.time(), offset\u003doffset, delta\u003ddelta, with_jitter\u003dTrue)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def __repr__(self):"},{"line_number":392,"context_line":"        return self._internal_format(self.timestamp, self.hex_part, True)"}],"source_content_type":"text/x-python","patch_set":2,"id":"80b0a230_32fca90e","line":389,"updated":"2026-01-07 01:08:57.000000000","message":"I feel this is strange that Timestamp constructor has ``with_jitter\u003dFalse`` but Timestamp.now() will turn on ``with_jitter\u003dTrue``\n\nSince s3api calls Timestamp.now() explicitly (https://github.com/NVIDIA/swift/blob/master/swift/common/middleware/s3api/controllers/obj.py#L166-L167) and s3api is the dominate use case, can we expose ``with_jitter\u003dFalse`` to the signature of ``now``?","commit_id":"388993326100247478443fcf74e7c1cc4663ba30"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c42ed3a3728d95b8ba052ce015ecae21c9efd179","unresolved":true,"context_lines":[{"line_number":386,"context_line":"        Returns an instance of a Timestamp at the current time plus random"},{"line_number":387,"context_line":"         jitter."},{"line_number":388,"context_line":"        \"\"\""},{"line_number":389,"context_line":"        return cls(time.time(), offset\u003doffset, delta\u003ddelta, with_jitter\u003dTrue)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def __repr__(self):"},{"line_number":392,"context_line":"        return self._internal_format(self.timestamp, self.hex_part, True)"}],"source_content_type":"text/x-python","patch_set":2,"id":"43e1ed67_ed2b912a","line":389,"in_reply_to":"80b0a230_32fca90e","updated":"2026-01-07 10:33:03.000000000","message":"``Timestamp.now()`` should be the recommended way to construct a timestamp for requests. So I do want ``Timestamp.now()`` to return a Timestamp with jitter. \n\n``S3Timestamp.now()`` inherits ``Timestamp.now()`` so when used it gets a timestamp with jitter for S3 requests. This is what we want. \n\noff-topic: Curiously, s3api only adds x-timestamp to the swift request for *regular* object PUT/DELETE and MPU part PUT. s3api does not add x-timestamp to MPU complete, multi-delete or buckets requests. See https://review.opendev.org/c/openstack/swift/+/972334. But I don\u0027t think s3api _needs_ to add x-timestamp to any swift request because the proxy app will do that (or another middleware).\n\nBackground: I grew uncomfortable with the constructor, that accepts a float, adding jitter by default. A caller of ``Timestamp(\u003cfloat\u003e)`` might reasonably have the expectation that the returned Timestamp is at exactly \u003cfloat\u003e time (well, \u003cfloat\u003e rounded to 5 decimal places). Adding jitter by default could be a surprise.\n\nI *am* comfortable with ``Timestamp.now()`` adding jitter by default because \"now\" is an abstract concept - the caller doesn\u0027t expect any specific float or hex_part value. And so far I prefer that this happens by default to avoid us accidentally creating request timestamps that do not have jitter.\n\nI\u0027d be OK with ``Timestamp.now()`` having a ``with_jitter\u003dTrue`` kwarg (note: default is True) in case a caller specifically wants a jitter-less timestamp. IIRC there are some use cases where that might be *ok*, but I\u0027m not sure yet if it is *necessary* in those cases if there is jitter or not.\n\nShall we approach this from considering those use-cases? do we have calls to ``Timestamp.now()`` where we would prefer the result to NOT have jitter? if so then we can add ``with_jitter\u003dFalse``, or perhaps even a mandatory ``with_jitter`` arg.","commit_id":"388993326100247478443fcf74e7c1cc4663ba30"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c42ed3a3728d95b8ba052ce015ecae21c9efd179","unresolved":true,"context_lines":[{"line_number":300,"context_line":"        # TODO: I\u0027m inclined make the default False and have"},{"line_number":301,"context_line":"        #  Timestamp.now() set with_jitter\u003dTrue. That would be more explicit"},{"line_number":302,"context_line":"        #  than init\u0027ing with a float but getting a float plus some jitter as"},{"line_number":303,"context_line":"        #  a side-effect."},{"line_number":304,"context_line":"        \"\"\""},{"line_number":305,"context_line":"        Create a new Timestamp."},{"line_number":306,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"a552ce23_cfd72aa2","line":303,"updated":"2026-01-07 10:33:03.000000000","message":"remove comment","commit_id":"32f5dd158a399651d3c11ac75bd95a69c3714525"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c42ed3a3728d95b8ba052ce015ecae21c9efd179","unresolved":true,"context_lines":[{"line_number":317,"context_line":"        :param check_bounds: if True (default) then a ValueError will be raised"},{"line_number":318,"context_line":"            if the given timestamp is less than 0 or greater than the maximum"},{"line_number":319,"context_line":"            time that can be represented by this class."},{"line_number":320,"context_line":"        :param with_jitter: If True (default) then a random jitter amount"},{"line_number":321,"context_line":"            will be inserted into the hex part of the timestamp."},{"line_number":322,"context_line":"        \"\"\""},{"line_number":323,"context_line":"        hex_part \u003d 0"}],"source_content_type":"text/x-python","patch_set":3,"id":"d7f20118_6136d511","line":320,"updated":"2026-01-07 10:33:03.000000000","message":"update docstring","commit_id":"32f5dd158a399651d3c11ac75bd95a69c3714525"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c42ed3a3728d95b8ba052ce015ecae21c9efd179","unresolved":true,"context_lines":[{"line_number":384,"context_line":"    def now(cls, offset\u003d0, delta\u003d0):"},{"line_number":385,"context_line":"        \"\"\""},{"line_number":386,"context_line":"        Returns an instance of a Timestamp at the current time plus random"},{"line_number":387,"context_line":"         jitter."},{"line_number":388,"context_line":"        \"\"\""},{"line_number":389,"context_line":"        return cls(time.time(), offset\u003doffset, delta\u003ddelta, with_jitter\u003dTrue)"},{"line_number":390,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"d4834e78_b8fb1820","line":387,"updated":"2026-01-07 10:33:03.000000000","message":"Add a note that this is the preferred way to get a fresh timestamp.","commit_id":"32f5dd158a399651d3c11ac75bd95a69c3714525"}]}
