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 duplicate events bug #14020

Merged
merged 9 commits into from
Apr 14, 2023
Merged

Fix duplicate events bug #14020

merged 9 commits into from
Apr 14, 2023

Conversation

yzhan289
Copy link
Contributor

@yzhan289 yzhan289 commented Feb 22, 2023

What does this PR do?

This PR simplifies the event collection logic since it was causing a bug where the same event was being sent over and over again rather than new events.

Motivation

Bug

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached
  • If the PR doesn't need to be tested during QA, please add a qa/skip-qa label.

silk/hatch.toml Outdated Show resolved Hide resolved
@yzhan289 yzhan289 marked this pull request as ready for review March 31, 2023 19:46
@yzhan289 yzhan289 requested a review from a team as a code owner March 31, 2023 19:46
@github-actions
Copy link

The validations job has failed; please review the Files changed tab for possible suggestions to resolve.

@yzhan289 yzhan289 changed the title Fix silk events bug Fix duplicate events bug Mar 31, 2023
@steveny91
Copy link
Contributor

steveny91 commented Mar 31, 2023

What was the cause of the duplicated events? Was it not including a the latest event timestamp in the query?

EVENT_PATH = "events?timestamp__gte={}&timestamp__lt={}"

@yzhan289
Copy link
Contributor Author

yzhan289 commented Apr 3, 2023

What was the cause of the duplicated events? Was it not including a the latest event timestamp in the query?

EVENT_PATH = "events?timestamp__gte={}&timestamp__lt={}"

The main cause is that the Silk environment is around 12 minutes ahead of the actual time. Since in my original implementation, I didn't include timestamp__lt={}, it would keep collecting the same event for 12 minutes since it uses the Agent's timestamp.

There was likely duplication also due to the multiple variables I juggled when determining the event timestamp, like having last_event_time, self.latest_event_query and collect_events_start_time. I'm simplifying it here to make it easier to understand.

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

The validations job has failed; please review the Files changed tab for possible suggestions to resolve.

steveny91
steveny91 previously approved these changes Apr 11, 2023
@github-actions
Copy link

Test Results

  4 files    4 suites   15s ⏱️
24 tests 24 ✔️ 0 💤 0
50 runs  48 ✔️ 2 💤 0

Results for commit e1f25f9.

@codecov
Copy link

codecov bot commented Apr 14, 2023

Codecov Report

Merging #14020 (e1f25f9) into master (2cbd09e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Flag Coverage Δ
silk 93.69% <100.00%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@yzhan289 yzhan289 merged commit 1981148 into master Apr 14, 2023
@yzhan289 yzhan289 deleted the az/silk-events-bug branch April 14, 2023 18:52
github-actions bot pushed a commit that referenced this pull request Apr 14, 2023
* Fix silk events bug

* Add ending time for event query

* Update debug log level from warn to error

* Add freezegun to agent-requirements

* Limit freezegun testing to Py3

* Use 0.3.15 instead of new non-Py2 version to support Py2

* Fix style 1981148
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

2 participants