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

fix(userspace/libsinsp): elems in mpsc queue with same priority follow push order #1504

Merged
merged 1 commit into from Nov 23, 2023

Conversation

jasondellaluce
Copy link
Contributor

@jasondellaluce jasondellaluce commented Nov 23, 2023

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area libsinsp

Does this PR require a change in the driver versions?

What this PR does / why we need it:

The multi-producer-single-consumer queue follows the given priority order and is used for ordering by timestamp async events in the async queue (with -1 being the dummy timestamp with max priority, representing "pop as soon as possible" events).

Elements with the same timestamp do not follow a specific order. However, this is a bug and a breaking changes compared to the previous behavior, in which all elements had -1 timestamp and followed the order in which they were pushed in the queue. This PR fixes and tests this behavior by making sure that elements with the same priority in the queue follow their time of arrival, thus making the new async queue a complete superset of the previously-existing feature with no regression.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

…llow push order

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
@jasondellaluce
Copy link
Contributor Author

/milestone 0.14.0

@poiana poiana added this to the 0.14.0 milestone Nov 23, 2023
@poiana poiana added the size/M label Nov 23, 2023
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Nov 23, 2023

LGTM label has been added.

Git tree hash: 199f4e170620ef55e14ba42037c4fec5cff05ae9

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Nov 23, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, jasondellaluce

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Andreagit97,FedeDP,jasondellaluce]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit b1f439e into master Nov 23, 2023
26 checks passed
@poiana poiana deleted the fix/mpsc-queue-push-order-same-prio branch November 23, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants