Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Add blocking on the first event in the batch #91

Merged
merged 1 commit into from
Aug 15, 2022
Merged

Add blocking on the first event in the batch #91

merged 1 commit into from
Aug 15, 2022

Conversation

rdner
Copy link
Member

@rdner rdner commented Aug 12, 2022

Also:

  • changed the queue wrapper to support blocking Publish and
    non-blocking TryPublish.
  • removed returning ErrQueueIsFull from Publish since it was
    incorrect (Publish is blocking until the queue is available).
  • added context to Publish for future change in libbeat (adding
    cancel channel to each producer.

For more details see #84 (comment)

Closes #84

@rdner rdner self-assigned this Aug 12, 2022
@elasticmachine
Copy link
Contributor

elasticmachine commented Aug 12, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-08-12T19:12:21.445+0000

  • Duration: 11 min 42 sec

Test stats 🧪

Test Results
Failed 0
Passed 40
Skipped 0
Total 40

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Also:

* changed the queue wrapper to support blocking `Publish` and
non-blocking `TryPublish`.
* removed returning `ErrQueueIsFull` from `Publish` since it was
incorrect (`Publish` is blocking until the queue is available).
* Added context to `Publish` for future change in libbeat (adding
`cancel` channel to each producer.
* Fix flaky timestamp error check
@@ -240,15 +230,15 @@ func TestPublish(t *testing.T) {
status, ok := status.FromError(err)
require.True(t, ok, "expected gRPC error")
require.Equal(t, codes.InvalidArgument, status.Code())
require.Equal(t, tc.expectedMsg, status.Message())
require.Contains(t, status.Message(), tc.expectedMsg)
Copy link
Member Author

@rdner rdner Aug 12, 2022

Choose a reason for hiding this comment

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

This is to fix #90 (comment)

@rdner rdner marked this pull request as ready for review August 12, 2022 19:26
@rdner rdner requested a review from a team as a code owner August 12, 2022 19:26
@rdner rdner requested review from belimawr, fearful-symmetry, faec and cmacknz and removed request for a team August 12, 2022 19:26
@rdner rdner added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Aug 12, 2022
@cmacknz
Copy link
Member

cmacknz commented Aug 15, 2022

LGTM, I'll let @faec approve this one

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

Approving so we can get the tests fixed with the change to ignore the randomness in the Timestamp errors: https://github.com/elastic/elastic-agent-shipper/pull/91/files#r944769758

@rdner rdner merged commit 34571c4 into elastic:main Aug 15, 2022
@rdner rdner deleted the block-on-first-event branch August 15, 2022 18:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The PublishEvents RPC should block when the queue is full
3 participants