Skip to content

Add delay on AMQP 0-9-1 basic.get_empty response #12249

@LoisSotoLopez

Description

@LoisSotoLopez

Is your feature request related to a problem? Please describe.

We would like to have a mechanism for delying the response of basic.get_empty messages.

Developers o client applications may implement polling loops that just consume from a queue using basic.get AMQP message, process the response and execute the next iteration.

When the consumed queue is empty, those loop iterations may execute too quickly, issuing an excessive number of requests and increasing the CPU usage on the server.

This is of course a bad practice, but still happens.

Describe the solution you'd like

Similarly to what is done to prevent DOS due to repeated failed logins from a client (PRs here and here) we wanted to suggest some similar mechanism to mitigate the effect of basic.get client tight loops.

A configurable delay, defaulting to 0, could be added before responding with a basic.get_empty message.

Describe alternatives you've considered

No response

Additional context

If limit-based events (#11207) get implemented we could use them to detect situations subject of causing a DOS, like the one described above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions