Skip to content

Weekly enviroment vanilla work with snapshot#9

Draft
ofiriro3 wants to merge 33 commits intovanilla_pocfrom
weekly-enviroment-vanilla-work-with-SNAPSHOT
Draft

Weekly enviroment vanilla work with snapshot#9
ofiriro3 wants to merge 33 commits intovanilla_pocfrom
weekly-enviroment-vanilla-work-with-SNAPSHOT

Conversation

@ofiriro3
Copy link
Owner

Summary of your changes

Screenshot/Data

Related Issues

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary README/documentation (if appropriate)

ofiriro3 and others added 30 commits February 14, 2023 18:38
Bumps [oauthlib](https://github.com/oauthlib/oauthlib) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/oauthlib/oauthlib/releases)
- [Changelog](https://github.com/oauthlib/oauthlib/blob/master/CHANGELOG.rst)
- [Commits](oauthlib/oauthlib@v3.2.1...v3.2.2)

---
updated-dependencies:
- dependency-name: oauthlib
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oren Zohar <85433724+oren-zohar@users.noreply.github.com>
Co-authored-by: Dmitry Gurevich <99176494+gurevichdmitry@users.noreply.github.com>
…ic#751)

Bumps [github.com/elastic/elastic-agent-libs](https://github.com/elastic/elastic-agent-libs) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/elastic/elastic-agent-libs/releases)
- [Commits](elastic/elastic-agent-libs@v0.3.0...v0.3.1)

---
updated-dependencies:
- dependency-name: github.com/elastic/elastic-agent-libs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oren Zohar <85433724+oren-zohar@users.noreply.github.com>
* fix: concurrency in `awslib.MultiRegionFetch`

The `awslib.MultiRegionFetch` function used to share the `error` from
multiple go routines.
Every go routine that called the `fetcher` function was able to update
this variable.

* feat: test cloudbeat also with -race flag

1. Add new step to UnitTest workflow with race detection flag in the `go
test` command.
2. Increase the overall timeout of the CI as the new step adding
   requires more time.

* fix: concurrency in `fetchersManager.Data`

The `Data` used to use `sync.WaitGroup` in two usecases:
1. Waiting for all the fetchers to complete the work
2. When `Data.Stop` is called to make sure that it also waits for all
   the fetchers to complete

Those two usecase used to share the same instance of `sync.WaitGroup`
from different go routines.

By removing the `wg.Wait` from `Data.Stop` the race was removed.

To make sure aligment, the changes are:
1. Remove `Data.Stop` to allow it to be called twice. So `Data.Run` will
   return `Stop` funciton is a wrapper around `Data.stopData` and can
ensure that it will be executed only once (the pattern is similar to
ctx, cancel := context.WithTimeout)
2. Adding `Data.stopNotice` propery as channel to make sure that once
   the stop funciton is called, no more fetchers will be executed.
3. Running `Data.fetchIterantion` as separate go routine will make sure
   that it will not block. So that the `Data.fetchAndSleep` can still
wait receive data from the channels
4. Stop function will get now grace period to wait before the fetchers
   are stopped.
5. Adding cancelable context to `Data.fetchAndSleep` and canceling it when
the stop channel is closed will get the same result.

* refactor: replace time.After with time.NewTimer

`time.After` is using `time.NewTime` https://pkg.go.dev/time#example-Time.After.
by using directly `time.NewTime` we can call the `Data.fetchIteration`
in one place.
The zero interval will make sure to trigger it immediatly and after that
we reset it to the input interval

* refactor: use atomic
* Initial vulnerability push

* Fixing depend

* Partial commit

* Avoiding deadlock on boltdb

* CR changes

* Fixing go tidy

* Fixing CR rebase

* Cleanup of tidy

* Mocking client

* Bumping version and rename type

* Initial vulnerability push

* Fixing depend

* Partial commit

* Avoiding deadlock on boltdb

* CR changes

* Fixing go tidy

* Fixing CR rebase

* Cleanup of tidy

* Mocking client

* Bumping version and rename type

* Rebase with concurrency

* Update go version

* Fixing lint problems

* Fixing lint assignment

* Removing due to mage config problems
* add s3 test case

* add additional test cases for 2.1.1

* update skip_param_case function and refactor code

* rename test and refactor code
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.

6 participants