Skip to content
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

RabbitMQ queue details parsing doesn't account for duplicated elements #4490

Merged
merged 8 commits into from
Oct 3, 2024

Conversation

danielmarbach
Copy link
Contributor

@danielmarbach danielmarbach commented Oct 2, 2024

In some cases, RabbitMQ management API might return json elements with duplicated keys.

For example, with one of the customers it returned a duplicated memory element

{
    "filtered_count": 44,
    "item_count": 44,
    "items": [
        {
            "arguments": {
                "x-queue-type": "quorum"
            },
            "auto_delete": false,
            "consumer_capacity": 1,
            "consumer_utilisation": 1,
            "consumers": 1,
            "durable": true,
            "effective_policy_definition": {},
            "exclusive": false,
            "leader": "rabbit@7509bf5e7b2a",
            "members": [
                "rabbit@7509bf5e7b2a"
            ],
            "memory": 112564,
            "memory": 112564,

By accessing the json object dictionary, the dictionary is initialized and cannot contain multiple keys. JsonElement is more flexible in that regard.

Both this tool and ServiceControl lack proper testing infrastructure in place to reproduce these problems so I ended up manually loading a fake Json payload from a filestream into the parser.

@danielmarbach danielmarbach marked this pull request as ready for review October 2, 2024 15:46
@danielmarbach
Copy link
Contributor Author

In Particular/Particular.EndpointThroughputCounter#848 I went down the rabbit hole of adding more coverage for the paging etc. which didn't exist but ran out of time to catch up here with things too.

@jpalac jpalac added the Bug label Oct 2, 2024
@PhilBastian PhilBastian added this to the 5.11.0 milestone Oct 2, 2024
@PhilBastian PhilBastian changed the title Fix the RabbitMQQueueDetails parsing to account for duplicated elements RabbitMQQueueDetails parsing doesn't account for duplicated elements Oct 2, 2024
@jpalac jpalac merged commit 1e04d10 into master Oct 3, 2024
31 checks passed
@jpalac jpalac deleted the rabbitmq_throughput branch October 3, 2024 22:29
@jpalac jpalac changed the title RabbitMQQueueDetails parsing doesn't account for duplicated elements RabbitMQ queue details parsing doesn't account for duplicated elements Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants