-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
Flipper Redis Adapter ignoring configuration block sometimes #856
Comments
@micahtessler I'm not sure how to reproduce this. It sounds like Flipper is getting used during the boot process prior to your custom config possibly? @bkeepers does it sound like that to you or do you have any different ideas? One option to figure out where this is happening is to Can you give that a try and let me know if it helps? |
I agree, that's what it sounds like.
If youc an paste the whole stack trace, we should be able to tell if it's happening during app boot and where. |
Not sure what you reference as the boot process. The first initialization happens correctly as you can see above, it calls into my initializer config. so it there was a boot problem, I would expect the opposite, the first initialization would not get the config as it hadn't been set. |
What from the stack trace do you need to see specifically? |
When upgrading from flipper 1.1.2 to flipper 1.2.2 the behavior of the redis adapter changed.
Sometimes it initializes from my configuration block:
Other times, it ignores that block and uses the block at the bottom of the flipper redis adapter
flipper/lib/flipper/adapters/redis.rb
Line 209 in 0e99629
I edited my local copies of the gems to dump the stack to trace the problem (so some line numbers don't 100% line up).
When I start my rails application in puma, I see the redis adapter initializing 3 times.
Once with the adapter constructed in my code and twice with the adapter constructed from the flipper redis adapter gem
If I make a request that gets the adapter I initialized, the page renders.
If I make a request with the adapter initialized by the redis adapter, the page errors because the redis URL is incorrect.
The stack trace of the good adapter (the first one that intializes)
The stack trace of the bad adapters (the second 2)
The branching happens with how the adapter builder constructs the redis adapter.
Of course, I can get around the problem if I set the env var
FLIPPER_REDIS_URL
However, the documentation doesn't specify that the URL has to come from an env variable.
https://www.flippercloud.io/docs/adapters/redis
It's somewhat inconvenient to have to set the env variable. I have been trying to figure out what changed. I didn't need to set the env var in version 1.1.2.
The text was updated successfully, but these errors were encountered: