-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat!: correct configuration params, stream reconnects, add tests #104
base: main
Are you sure you want to change the base?
feat!: correct configuration params, stream reconnects, add tests #104
Conversation
2db5904
to
e826b3d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #104 +/- ##
==========================================
+ Coverage 93.92% 94.28% +0.36%
==========================================
Files 14 17 +3
Lines 675 858 +183
==========================================
+ Hits 634 809 +175
- Misses 41 49 +8 ☔ View full report in Codecov by Sentry. |
e826b3d
to
96ecdc1
Compare
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey.one@gmail.com>
Signed-off-by: Cole Bailey <cole.bailey.one@gmail.com>
Signed-off-by: Cole Bailey <cole.bailey.one@gmail.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
96ecdc1
to
8a15f87
Compare
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
8a15f87
to
36269b5
Compare
return | ||
except grpc.RpcError as e: | ||
logger.error(f"SyncFlags stream error, {e.code()=} {e.details()=}") | ||
if e.code() == grpc.StatusCode.UNAVAILABLE: |
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.
destroying the existing channel, and creating a new one, actually fixed the reconnect issue. i am not sure, if this is best practice, or should be avoided.
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.
I wonder if we need to handle more cases than this? UNKNOWN
perhaps? Just wondering if other sorts of network errors that result in the same bad state might not be handled because they return a different status.
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.
For me it is really hard to judge, my grpc knowledge is Limited, and I would fully rely on your opinion. If you do think it make sense let's go for it.
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.
My gut says since we don't 100% understand why we observe this behavior, we should play it safe and recreate the stub on any grpc.RpcError
; in particular I'm worried that if we don't, the stream deadline functionality might not work reliably.
I think there's not much risk here since this is only for the stream call and if we're having a problem with that, pretty much nothing else in this resolver mode is working anyway.
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.
Done here: f91dd5c
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Could you please clarify what part of the pr is breaking? |
@beeme1mr ya, like I said above:
|
Sorry, hard reject from me. This PR has way too many changes, which have nothing to do with each other and are debatable on their own. Like adding a caching library, adding suppression comments I don't really understand the reason to put everything into one big PR instead of tackling each topic on its own. 3 issues are referenced and each one can be done on its own and #55 is just a collection of TODOs, which again can be separated in multiple PRs. It's great @aepfli tackled all the issues, but not like this. |
I appreciate that keeping PRs to a single topic can aid in reviewing and just make things easier. However, this PR addresses real issues with this provider, some of which are hard to disentangle and benefit from going together, (for instance, it has an issue with the specified reconnect functionality, and this PR both fixes that an implements the associated e2e tests). Rejecting this PR is totally acceptable from my perspective, but I feel you should to offer @aepfli some actionable feedback and next steps if you are going to do so (such as how he should decompose the PR and resolve the suppressions). |
@toddbaert you can check the latest PRs @aepfli created in this repository and then suddenly closed all and merged everything into this one, for what reason? They were good on their own and addressed separate topics, like auto generating the grpc files or caching. |
@gruebel I am with you that this PR is quite large and is much work to review and that each PR should in the best case be tackling one thing. But I would like to be sure that we look for a way forward instead of "just rejecting". We should be sure that the change can even be untangled before saying that we are not accepting anything because of size or multiple solved issues. Maybe @aepfli can tell if these are separable or we just accept this once and review this large PR, while keeping on to try to do PRs as small as possible. |
I can, and gladly will split it up into 4 parts again:
The config adaptations (Ms and seconds) also make sense because this syncs the behavior of environment flags for all providers. Java is in MS and is, IMHO, the most advanced provider for flags; hence, we should adhere to its environment variables usage and values, or else we have way more things to change. We use the same environment variables to make it easy to configure multiple providers with the same environment variables. This provider did not reach version 1, making it a better target than Java. The same applies to the resolver's name. Everywhere else, it is named RPC; here, we do have GRPC. We should normalize this for consistency and easier maintenance in the long run. A good thing is that all the features implemented fulfill the test-harness gherkin files. We're compliant with the expectations of flagd for a provider - confidence we did not have before. I also suggest not looking for perfect code; this confidence allows us to iterate faster and ship improvements confidently. |
Thanks @aepfli! That should make it easier to review and make our release notes more accurate. |
Besides the fact this is what Java does, these are actually in the spec for flagd providers, and are important for interop with the Operator. But it sounds like we have a plan for moving forward! Feel free to link your other PRs to this one and close this one whenever @aepfli |
this one is the last in the chain, i will update it and mark it as soon as we are ready |
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
28914fa
to
6b21f96
Compare
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
6b21f96
to
a37e5a3
Compare
This pull request contains all my previous changes. and it has all the configuration properties maintained for everything.
I changed the times for the initialization to ms - to be in sync configuration-wise with the Java application (which might not be a good idea)
I removed
timeout
and replaced it withdeadline
; additionally, I added a deprecation note.Every Implementation does not take all the corresponding configurations into account.
Resolves: #57
Resolves: #56
Resolves: #55