-
Notifications
You must be signed in to change notification settings - Fork 71
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: set readiness once only #465
Conversation
Codecov Report
@@ Coverage Diff @@
## main #465 +/- ##
==========================================
- Coverage 62.24% 62.12% -0.13%
==========================================
Files 13 13
Lines 1658 1650 -8
==========================================
- Hits 1032 1025 -7
+ Misses 563 562 -1
Partials 63 63
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
25e8051
to
ffea86f
Compare
The readiness state should change since this tells K8s when traffic can be scheduled to that Pod, but it depends on our semantics of ready state. With this change, we lost consistency in favor of availability and partition tolerance. Given that flagd is injected as a sidecar by OFO, I suggest going ahead with this change since it makes it more resilient and doesn't block traffic to the original pod. |
I may have misunderstood the first PR introducing health checks or misread the code, because I thought this was already how it was implemented:
😅 |
Can we add some tests to establish expectations around this behavior? Perhaps it will be easier once this is merged? |
Can you please include a section in the docs that describes the behavior in a follow up PR? An example of what I'm looking for can be found here. Users should be able to understand what endpoints are available and the behavior to expect when using them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
7f5e4cf
to
2b0e7f1
Compare
@toddbaert I added readiness state validation except for K8s |
🤖 I have created a release *beep* *boop* --- ## [0.4.1](v0.4.0...v0.4.1) (2023-03-07) ### 🔄 Refactoring * remove unused struct field ([#458](#458)) ([a04c0b8](a04c0b8)) ### 🧹 Chore * **deps:** update sigstore/cosign-installer digest to bd2d118 ([#471](#471)) ([ee90f48](ee90f48)) ### 🐛 Bug Fixes * **deps:** update module github.com/open-feature/go-sdk-contrib/providers/flagd to v0.1.10 ([#459](#459)) ([cbdf9b0](cbdf9b0)) * **deps:** update module golang.org/x/net to v0.8.0 ([#468](#468)) ([10d5f2c](10d5f2c)) * fix broken image signing ([#461](#461)) ([05bb51c](05bb51c)) * fixing image delimeter ([#463](#463)) ([b4ee495](b4ee495)) * security issues ([#464](#464)) ([7f1e759](7f1e759)) * set readiness once only ([#465](#465)) ([41a888d](41a888d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR
The current readiness state can be changed because of an underlying sync provider error. This seems to be incorrect as not ready state make flagd to not receive traffic through K8s services [1]
For example, if HTTP endpoint-backed sync provider get an error, the current logic set readiness to
false
. Similarly, if grpc connectivity is lost for grpc provider, readiness goes tofalse
state till connection establishment completes.This PR fix this behavior by setting the ready state once only per sync provider. This means if there is at least a single successful sync, sync provider sets its readiness to
true
.Going further, we might need to decide if we need better readiness state handling.
[1] - https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes