Comments (2)
I am not sure this will work. Consider You have 3 nodes behind an LB. If redis fails and then you have in-memory singleflight request, you may still get 3 single flight requests overwriting each other. I am not sure if there is a good way to guarantee uniqueness.
the easiest way is to probably write a new singleflight type backed by a managed by a cloud provider just like storage.
from athens.
Consider You have 3 nodes behind an LB. If redis fails and then you have in-memory singleflight request, you may still get 3 single flight requests overwriting each other.
Yes if the fallback is configured to use in-memory then that's the expected behaviour after this implementation. The idea is to let it work even after redis is down, currently it doesn't work at all.
you may still get 3 single flight requests overwriting each other. I am not sure if there is a good way to guarantee uniqueness.
Also, like I described above - another distributed store (redis/ etcd etc.) can also be used as fallback so it can still guarantee uniqueness, it would just depend on your config.
Basically there're 3 possible scenarios:
- Fallback configured to "none": Don't use any fallback and return an error like the current behavior.
- Mainly for backwards compatibility or if you'd like to keep things simple and are okay with handling these situations manually.
- Fallback configured to "memory": Fallback to memory until the distributed store is up. Athens will continue working but distributed singleflight won't work.
- Use this If you'd want Athens to continue working without distributed locking.
- Fallback configured to "etcd/redis/etc.": Fallback to another distributed cache until the primary one is up. Athens will continue working and distributed singleflight will also work.
- Use this If you'd want Athens to continue working with distributed locking and are okay with maintaining a secondary distributed store.
So based on the resiliency requirements of the users they will be able to configure Athens accordingly.
from athens.
Related Issues (20)
- Athens leaks etcd leases HOT 7
- Athens should not check the status of all etcd endpoints on startup
- Replace logrus with log/slog HOT 1
- How do I scale the athens container for better performance? HOT 1
- server response: 404 page not found HOT 1
- Limiting the maximum disk usage HOT 6
- always verifying module HOT 2
- Unix socket is not removed if athens crashes HOT 4
- Using proxy socks5 HOT 3
- arm64 build of v0.13.0 can not work
- Error message not clear HOT 2
- govulncheck mirror HOT 1
- Go 1.22 support HOT 2
- Coupling of CloudRuntime (ATHENS_CLOUD_RUNTIME) config var with log formatting is unexpected HOT 2
- Remove Circle CI HOT 1
- Duplicate HTTP `Content-Type` header HOT 2
- support the git-credential-manager HOT 2
- Use AWS SDK v2 for Go HOT 7
- Serve a SumDB
- Add a splash page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from athens.