Skip to content

Streaming connection error causes endless logs while offline  #38

@SLOSK

Description

@SLOSK

Is this a support request?
no
Describe the bug
When offline LD tries to connect to stream every second and prints two logs at the info level each time. We don’t mind that LD continuously tries to connect, but we would prefer a way to not print the errors every second as it spams our log files.
I believe it is a similar issue to the one described (and solved) in this thread: launchdarkly/react-client-sdk#2

To reproduce

  • Initialize LaunchDarkly client passing in a custom logger
  • Start application running LaunchDarkly, then go offline.
  • Watching log messages, “Opening stream connection to …” and “Closing stream connection” are printed repeatedly every 1 second

Expected behavior
That after the first warn log the info logs are printed once, not at all, or less frequently. In thread launchdarkly/react-client-sdk#2 they opt to print them once per disconnect.

Logs

{"level":"warn","message":"['Error on stream connection: getaddrinfo ENOTFOUND clientstream.launchdarkly.com, will continue retrying every 1000 milliseconds.']"}
{"level":"info", "message":"[ [ 'Opening stream connection to https://clientstream.launchdarkly.com/eval/***']]"}
{"level":"info","message":"[ [ 'Closing stream connection' ] ]"}

SDK version
1.6.3

Language version, developer tools
Electron: 13.6.3

OS/platform
Windows 10, MacOS(12.3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions