Code Monkey home page Code Monkey logo

Comments (5)

andreas-unleash avatar andreas-unleash commented on July 17, 2024 1

Hey, thank you for bringing this to our attention. We will raise it internally and get back to you with a response from the team.

In the meantime, can you provide us with some additional information to help reproduce it:

  • Server configuration
  • Environmant configuration

from unleash-client-rust.

skairunner avatar skairunner commented on July 17, 2024

Upon investigation, the conditions for this error being returned does indeed depend on non-Unleash software: The Unleash server was hosted on a Kubernetes cluster behind a Google load balancer. The server was being CPU-throttled and the load balancer returned the 502 message when it couldn't get a reply from Unleash.

Still, it might be good to have some better handling of server errors.

from unleash-client-rust.

thomasheartman avatar thomasheartman commented on July 17, 2024

Hey, @skairunner πŸ‘‹πŸΌ

Thanks again for raising this! Let me just make sure I get this right:

  • When the client receives a 502 response, it logs an error, then continues running. It will try fetching toggles again at the next interval.
  • When it receives a 502, you'd like/expect it to retry the toggle request after the specified interval.

Are those points correct?

We've talked briefly about this internally, and I think the reason it works the way it does is intentional. There's not much the SDK can do if it receives an error response, and it'll try again after the specified refresh interval anyway. In cases where you need to get updates immediately, you're probably best off bumping up the refresh rate.

Does that sound reasonable to you?

Still, it might be good to have some better handling of server errors.

That's a fair point! What would you classify as "better handling" in this case? What would you expect? ☺️

from unleash-client-rust.

skairunner avatar skairunner commented on July 17, 2024

After learning that it was not an Unleash server thing but rather from the load balancer, I think my ticket might be fine being closed πŸ˜… If it was inherently part of the unleash api then the client definitely would need to handle it, but since it's not...

The client doesn't currently log the 502 error at all: it simply says poll: failed to retrieve features; with PR #36 it says poll: failed to retrieve features - Error("expected value", line: 2, column: 1) which is not incredibly helpful either. In the project I'm working on, I added a small hack to print the actual json value that failed to parse which is how I discovered the issue. So I guess what is really needed is improved error reporting.

Please feel free to close this issue!

from unleash-client-rust.

thomasheartman avatar thomasheartman commented on July 17, 2024

Got it! In that case I'll close this for now ☺️ I think getting some more information would be good though; maybe it's something that can be worked into #36?

from unleash-client-rust.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.