-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NAS-133708 / 25.04 / Convert job ID to uuid #15454
base: master
Are you sure you want to change the base?
Conversation
b027f7c
to
4c7850c
Compare
In some CI runs it was observed that unexpected results were being returned for middleware jobs. This commit converts our job ids from being monotonically incrementing integer to proper uuid so that the job id that client is trying to track is guaranteed to uniquely identify it regardless of which HA node is being connected to.
4c7850c
to
98e4448
Compare
@@ -291,7 +289,7 @@ def __init__(self, middleware, method_name, serviceobj, method, args, options, p | |||
self.app = app | |||
self.audit_callback = audit_callback | |||
|
|||
self.id = None | |||
self.id = int(uuid4()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do self.id = uuid4().int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@undsoft will such long ints work well with JSON?
>>> uuid4().int
311364041177499672922985169261652976368
>>> uuid4().int
262998890057434762054815435825767399766
>>> uuid4().int
106487518651827065074465048916488123677
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hemming and hawing about that one. I may make it a string rather than number (e.g. "106487518651827065074465048916488123677"
) to make random JSON libraries happier. UI seems to not worry about consuming UUIDs here (nothing broke in an obvious way) as either a number or a string.
I would fix the client so it forgets all jobs when the connection is re-established. |
It's hard to control how clients will behave (outside of our own). |
In some CI runs it was observed that unexpected results were being returned for middleware jobs. This commit converts our job ids from being monotonically incrementing integer to proper uuid so that the job id that client is trying to track is guaranteed to uniquely identify it regardless of which HA node is being connected to.