Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Missing client keys #432

Closed
willscripted opened this issue Jan 8, 2013 · 5 comments
Closed

Missing client keys #432

willscripted opened this issue Jan 8, 2013 · 5 comments

Comments

@willscripted
Copy link

My two PRs skirt the root of the issue so I feel like I should log this issue So far I can't find a simple test case to reproduce it though. Here's the problem:

Background

We're using sensu to run checks and report events for ~ 600 servers. We have a handler to check keepalive events for servers that no longer exist. When appropriate, the handler makes a call to the API to delete the client.

Problem - Missing redis keys

Client keys are disappearing in redis. Eg. client:8eef4f7a-45f7-11e2-b603-12313d23e203 is nil when it should contain client data. This causes all sorts of problems down the pipe - anything that iterates through the 'clients' set and parses the JSON value expected for the keys indicated.

Symptoms

Those PRs are just fixing symptoms. Have not found a good solution for ensuring the db's integrity.
I believe the API and the server are the only ones to touch redis - is there anywhere else i should be looking?

@portertech
Copy link
Contributor

Is this an issue with concurrency? eg. concurrent DELETE /client/8eef4f7a-45f7-11e2-b603-12313d23e203 and one call is getting nil and attempting to parse it as JSON? Yes, the server/s & API/s are the only components that talk to Redis.

@willscripted
Copy link
Author

Unless a failure in one causes the processing in the 2nd to abort, I don't see how concurrency could create this behavior. I suppose messing up the redis connection might do that?

@willscripted
Copy link
Author

Found it - flood of keepalive messages off the queue caused em-redis callbacks to execute much, much later. Eg. a client would be added to the clients set 90 minutes after the client key was set. If the client was deleted in that 90 minutes, the key would exist in the set but the client:#{id} would have been removed. This extra key would cause everything else to barf

This was fixed by cf0b006 or whenever ack'ing was first added. Then keepalives wouldn't be crowding in memory, waiting to get processed

@portertech
Copy link
Contributor

@will-ob 0.9.9 includes many improvements, I recommend upgrading.

@willscripted
Copy link
Author

I expect/hope we will in the next two week =]
thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants