Actions
action #114529
openRabbitMQ: Wrong id type for restart events
Status:
New
Priority:
Normal
Assignee:
-
Category:
Regressions/Crashes
Target version:
QA (public, currently private due to #173521) - future
Start date:
2022-07-22
Due date:
% Done:
0%
Estimated time:
Tags:
Description
Observation¶
The id
type for job restart events is of type string, whereas it should be of type int.
e.g.
# Correct form for job.done: "id":10359
suse.openqa.job.done {"ARCH":"x86_64","BUILD":"0133","FLAVOR":"EC2-HPC-BYOS","HDD_1":"publiccloud_tools_0036.qcow2","MACHINE":"ec2_r4.8xlarge","TEST":"publiccloud_img_proof","bugref":null,"group_id":170,"id":10359,"newbuild":null,"reason":null,"remaining":0,"result":"user_cancelled"}
# Incrorrect form for job.restart: "id":"10359"
suse.openqa.job.restart {"ARCH":"x86_64","BUILD":"0133","FLAVOR":"EC2-HPC-BYOS","HDD_1":"publiccloud_tools_0036.qcow2","MACHINE":"ec2_r4.8xlarge","TEST":"publiccloud_img_proof","auto":0,"bugref":null,"group_id":170,"id":"10359","remaining":1,"result":{"10359":10360}}
Steps to reproduce¶
Observing the RabbitMQ stream and watching for job.restart events
Problem¶
This inconsistency causes problems when processing the json output with statically types programming languages like go
:
rabbitmq recv error: json: cannot unmarshal string into Go struct field JobStatus.id of type int
Suggestion¶
Change the json type of the job ID for job.restart events from string
to int
Workaround¶
None identified.
Updated by okurz over 2 years ago
- Category set to Regressions/Crashes
- Target version set to future
Workaround: use a weakly typed language, like Perl! ;)
Sounds like it should be simple enough to fix, but not planned for SUSE QE Tools right now
Updated by mkittler over 2 years ago
Or just explicitly convert to int64
. Note that the correct type to use in Go for our database IDs would likely be int64
(and not int
) because we always use 64-bit signed integers (bigint
in PostgreSQL).
Updated by szarate 4 months ago
- Related to action #165422: "which AMQP events does an instance publish?" size:M added
Actions