Closed scinos closed 5 years ago
Thanks for reporting this. We'll see if we can reproduce that behavior.
There are two other pieces of information that might be helpful:
localOverridePath
located relative to the application? Like, is it in the same directory as your source code, or is it in a special location like /tmp
, etc.Also, do I understand correctly that it starts out just loading the file at startup time, and doesn't do any unexpected reloads, until you do modify the file (or at least touch it in a way that modifies its timestamp), and then you get a bunch of reloads after that? And do the reloads always happen very close to each other?
Yeah, this wasn't hard to reproduce - I'm surprised we didn't see it earlier. It seems there's a known issue where Node's fs.watch()
, which is what this uses, can report extra change events for some reason. There are some other packages available that claim to be able to fix this, but rather than add more dependencies to the SDK, I think we'll probably just add a check on the file's last-modified timestamp.
In case it still helps:
'../../etc/launchdarkly-local'
Thanks. The fix is indeed pretty easy for Linux and Mac, but I'm still seeing some weird behavior on Windows (which we just started testing with recently), so I'll put out a patch as soon as I've figured that out.
We've released version 5.7.2 with a fix for this.
When reading FeatureFlags form a local file and using
autoUpdate
, it seems to reload it multiple times.After saving the file once (with no actual changes on the content of the file), I got
Some times I even get 3 or 4 reloads.
Relevant code:
Versions: