Skip to content

(fix): fix loop on batch event processor #224

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

Merged
merged 20 commits into from
Dec 5, 2019

Conversation

thomaszurkan-optimizely
Copy link
Contributor

Summary

  • The loop ends up running too often and not paying attention to flush interval.

Test plan

  • Needs unit tests

Issues

  • Batch event processor ends up in a tight always running loop when there are no events.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

Can you provide a unit test to prove that this fixes the issue?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 99.419% when pulling 9b8a645 on hotFixBatchEP into c720b02 on master.

@coveralls
Copy link

coveralls commented Dec 4, 2019

Coverage Status

Coverage increased (+0.01%) to 99.543% when pulling d1b9297 on hotFixBatchEP into 3e64576 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 99.419% when pulling 9b8a645 on hotFixBatchEP into c720b02 on master.


item = @event_queue.pop if @event_queue.length.positive?
item = @event_queue.pop if @event_queue.length.positive? || @use_pop
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a note here to explain what we are doing with the nil count?

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

Lgtm

@thomaszurkan-optimizely thomaszurkan-optimizely merged commit d70733c into master Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants