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

Handle in-progress events without deadlocking #63

Conversation

JacobHenner
Copy link
Contributor

When in-progress messages are sent to the eventStream channel,
lifecycle-manager deadlocks, since there are no eventStream receivers
running in a separate goroutine. Instead of sending the in-progress
messages to the eventStream channel, we can process them immediately as
we process SQS-driven events, avoiding the deadlock.

Resolves #62

When in-progress messages are sent to the eventStream channel,
lifecycle-manager deadlocks, since there are no eventStream receivers
running in a separate goroutine. Instead of sending the in-progress
messages to the eventStream channel, we can process them immediately as
we process SQS-driven events, avoiding the deadlock.

Resolves keikoproj#62
@JacobHenner JacobHenner requested a review from a team as a code owner September 10, 2020 13:48
@JacobHenner
Copy link
Contributor Author

This could be a bit more DRY, let me know if you'd like me to make changes.

@codecov
Copy link

codecov bot commented Sep 10, 2020

Codecov Report

Merging #63 into master will decrease coverage by 0.29%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #63      +/-   ##
==========================================
- Coverage   72.37%   72.08%   -0.30%     
==========================================
  Files          12       12              
  Lines         992      996       +4     
==========================================
  Hits          718      718              
- Misses        212      216       +4     
  Partials       62       62              
Impacted Files Coverage Δ
pkg/service/server.go 60.69% <0.00%> (-0.66%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5630e3...eb04015. Read the comment docs.

@eytan-avisror
Copy link
Collaborator

Thanks @JacobHenner this is great, I think the goal of the refactor was to reduce number of goroutines (hence getting rid of newWorker method) and optimize performance under high load of terminations - but you are absolutely right about the deadlock.

Copy link
Collaborator

@eytan-avisror eytan-avisror left a comment

Choose a reason for hiding this comment

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

🥇

@eytan-avisror eytan-avisror merged commit 8fb4633 into keikoproj:master Sep 10, 2020
@eytan-avisror eytan-avisror mentioned this pull request Sep 10, 2020
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.

Potential deadlock when trying to resume in-progress terminations
2 participants