-
Notifications
You must be signed in to change notification settings - Fork 56
upgrade connection error log from warn to error #183
Conversation
We had a connectivity issue between the client and ld-relay due to some misconfiguration. It resulted in apps not being able to connect to LaunchDarkly for a long time. It took a while to realize that the SDK actually logged a warning. It'd be nice if this was an error.
I think we need to be very careful about making a change like this. It's true that logging at ERROR level is more attention-getting, but that's a double-edged sword: we've had complaints before about logging too many things at ERROR that are not really show-stoppers. In this case, a temporary disconnection of the stream is not really all that unusual— it can happen due to random network glitches, or an update being deployed on our end— so customers might not appreciate getting a lot of monitoring alerts for that, as it's almost always brief and inconsequential and not something they can do anything about. I think that in some of the SDKs, some things like that are still being logged as ERROR but in general we've been trying to standardize toward using that very sparingly. I think what would probably be more useful is the change you requested elsewhere: programmatic access to the current state of the connection. That's something that is implemented in most of our mobile SDKs, but it currently doesn't exist in the server-side ones; we're definitely considering it, but it would be something we would add across the board, not just in Java, and it'll require some architectural changes. The other thing we've considered adding is some logic that would have it make more noise if the connection stays bad for some significant amount of time. |
Thanks for the thoughtful response @eli-darkly! I understand the preference toward something more holistic and I totally agree. In the meanwhile though, the stream processor is already logging bad http codes on the error level:
An alternative: Maybe we can make some more noise on a failed first attempt, since that might be an indicator that the app is misconfigured or something else is really broken. That's the real thing I want to address in this PR. Happy to update my PR to do that. |
misc cleanup in new APIs
Update: what we are planning to do for the 5.0.0 release (although it didn't make it into the 5.0.0-rc1 beta) is as follows:
|
So, since the 5.0.0 release will be coming fairly soon, and without that new configuration mechanism I think making it log either more or less stuff at I'm still thinking about this suggestion—
—but it would depend on what's meant by "some more noise". I feel like |
Actually - I just checked the code, and the SDK already does log the "did not successfully startup within the startup timeout" at try {
startFuture.get(this.config.startWaitMillis, TimeUnit.MILLISECONDS);
} catch (TimeoutException e) {
logger.error("Timeout encountered waiting for LaunchDarkly client initialization");
} catch (Exception e) {
logger.error("Exception encountered waiting for LaunchDarkly client initialization: {}", e.toString());
logger.debug(e.toString(), e);
} |
We had a connectivity issue between the client and ld-relay due to some
misconfiguration. It resulted in apps not being able to connect to
LaunchDarkly for a long time.
It took a while to realize that the SDK actually logged a warning. It'd
be nice if this was an error, since at least for us, that gets sent to more noticeable places.