mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-14 14:58:02 +00:00
Every usage of this just ran keepAlive func as a goroutine with a timer, using a parent context, but the keepAlive func didn't know about that context, so it couldn't use that context for its own messages or interactions. Change it to create its own cancelable context from a provided parent, and use that to control its inner behavior. Note that we *do* still need to send the revoke at least sometimes -- otherwise cluster states don't update correctly. But we can time that send out rather than using context.Background(), because after a TTL's worth of time, there's no lease to revoke anyway. Also, add hooks for testhook tracking so we can confirm/deny that things are getting shut down, which they weren't. |
||
|---|---|---|
| .. | ||
| cache.go | ||
| embed.go | ||