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 the eventingReady status change right after the backend switch #12312

Conversation

vpaskar
Copy link
Contributor

@vpaskar vpaskar commented Oct 7, 2021

Description

Changes proposed in this pull request:

  • fixed the status change logic for eventPublisherReady
  • added the pods mocking into the unit tests

Related issue(s)

@kyma-bot
Copy link
Contributor

kyma-bot commented Oct 7, 2021

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kyma-bot kyma-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 7, 2021
@CLAassistant
Copy link

CLAassistant commented Oct 7, 2021

CLA assistant check
All committers have signed the CLA.

@kyma-bot kyma-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 7, 2021
@kyma-bot kyma-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 15, 2021
@netlify
Copy link

netlify bot commented Oct 15, 2021

✔️ 🥰 Documentation preview ready! 🥰

🔨 Explore the source changes: 14337c1

🔍 Inspect the deploy log: https://app.netlify.com/sites/kyma-project-docs-preview/deploys/61840c0393f808000825ccc2

😎 Browse the preview: https://deploy-preview-12312--kyma-project-docs-preview.netlify.app

@vpaskar vpaskar self-assigned this Oct 18, 2021
@vpaskar
Copy link
Contributor Author

vpaskar commented Oct 18, 2021

/test all

@@ -1282,6 +1283,8 @@ func createSubscriptionObjectsAndWaitForReadiness(ctx context.Context, givenSubs
// countBEBRequests returns how many requests for a given subscription are sent for each HTTP method
func countBEBRequests(subscriptionName string) (countGet int, countPost int, countDelete int) {
countGet, countPost, countDelete = 0, 0, 0
var mutex = &sync.Mutex{}
Copy link
Contributor

Choose a reason for hiding this comment

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

thats not how a mutex works. The idea is that all potential accessors of the mutexed resource, need to acquire the lock of the mutex. as only one can get this at a time the access to the resource is not access simultaneously

Copy link
Contributor Author

@vpaskar vpaskar Oct 20, 2021

Choose a reason for hiding this comment

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

I added a global RWMutex

@kyma-project kyma-project deleted a comment from kyma-bot Nov 9, 2021
@mfaizanse mfaizanse added the lgtm Looks good to me! label Nov 10, 2021
@vpaskar vpaskar removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 10, 2021
@kyma-bot kyma-bot merged commit 2be9f77 into kyma-project:main Nov 10, 2021
@kyma-bot
Copy link
Contributor

@VladislavPaskar: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pre-main-kyma-integration-k3d 2c1e4e3 link unknown /test pre-main-kyma-integration-k3d
pre-main-kyma-integration-k3d-central-app-connectivity 2c1e4e3 link unknown /test pre-main-kyma-integration-k3d-central-app-connectivity
pre-main-kyma-integration-k3d-compass-dev 2c1e4e3 link unknown /test pre-main-kyma-integration-k3d-compass-dev

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

friedrichwilken pushed a commit to friedrichwilken/kyma that referenced this pull request Nov 15, 2021
…yma-project#12312)

* fix the eventingReady status change right after the backend switch

* add pod's generation in the unit tests; check for pod status when setting the publisherReady flag

* fix imports and codestyle

* lock the beb.requests during the iteration

* use RWmutex instead of the normal one

* revert the sleep

* reduce amount of nested loops, some code adjustments

* fix imports

* remove mutex, add early return

* fix condition, improve for loops

* update mocked pod's status

* remove comment

* bump the image to solve the security issue
mfaizanse pushed a commit to mfaizanse/kyma that referenced this pull request Nov 19, 2021
…yma-project#12312)

* fix the eventingReady status change right after the backend switch

* add pod's generation in the unit tests; check for pod status when setting the publisherReady flag

* fix imports and codestyle

* lock the beb.requests during the iteration

* use RWmutex instead of the normal one

* revert the sleep

* reduce amount of nested loops, some code adjustments

* fix imports

* remove mutex, add early return

* fix condition, improve for loops

* update mocked pod's status

* remove comment

* bump the image to solve the security issue
mfaizanse pushed a commit to mfaizanse/kyma that referenced this pull request Nov 19, 2021
…yma-project#12312)

* fix the eventingReady status change right after the backend switch

* add pod's generation in the unit tests; check for pod status when setting the publisherReady flag

* fix imports and codestyle

* lock the beb.requests during the iteration

* use RWmutex instead of the normal one

* revert the sleep

* reduce amount of nested loops, some code adjustments

* fix imports

* remove mutex, add early return

* fix condition, improve for loops

* update mocked pod's status

* remove comment

* bump the image to solve the security issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/eventing Issues or PRs related to eventing lgtm Looks good to me! size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect status update sequence on Eventing-Backend when switching backends
6 participants