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/test): avoid deadlocks in mpsc queue tests #1667

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

jasondellaluce
Copy link
Contributor

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area libsinsp

/area tests

Does this PR require a change in the driver versions?

Nah

What this PR does / why we need it:

We're experiencing deadlocks on the concurrent tests on the MPSC priority queue, so far only on aarch64 in our CI. This may either reveal a thread-safety issue in the queue's implementation, or may just be pathological due to the scheduler being unpredictable -- the queue can order elements already pushed, but can't know if an higher-priority event is not yet pushed due to its producer being sleepy. This PR solves the issue by making the test fail with a timeout, and provides more in-depth messages about the failure. Also, the exit condition of the loop was still faulty in case of out-of-order elements, so this should also be cleared now.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

This will hopefully accomodate the Windows runners of our CI,
which seem to produce ~64 elements per second :/

Signed-off-by: Jason Dellaluce <[email protected]>
@poiana poiana added the lgtm label Feb 1, 2024
@poiana
Copy link
Contributor

poiana commented Feb 1, 2024

LGTM label has been added.

Git tree hash: d8d28af59bbb75f63fa665d5d1ec54824203c381

@Andreagit97 Andreagit97 added this to the 0.15.0 milestone Feb 1, 2024
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 Feb 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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,jasondellaluce,leogr]

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 6602651 into master Feb 1, 2024
34 checks passed
@poiana poiana deleted the fix/test-mpsc-queue-deadlock branch February 1, 2024 09:17
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.

4 participants