Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
darron committed Nov 12, 2015
1 parent 596941a commit f9f0057
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ It's a [fairly well known limitation that doesn't have a fix at the moment](http

If it's a really lightweight item - no problem - but if it's not so lightweight - then it can be a bit of a problem.

If you take a look at what the watch passes on STDIN - you will see that if it's not actually firing it just passes:
If you take a look at what the watch passes on STDIN during a Consul reload - you will see that if it's not actually firing it just passes:

`[]\n`

So - `sifter` is a small Go binary that helps protect against watches firing when they shouldn't:
So - `sifter` is a small Go binary that helps protect against event watches firing repeatadly:

```
{
Expand All @@ -27,10 +27,18 @@ So - `sifter` is a small Go binary that helps protect against watches firing whe

When this gets loaded into Consul - instead of launching copies and copies of `chef-client` processes - which is not awesome I promise - it will just say:

`stdin='blank' NOT running 'chef-client'`
`location='blank' elapsed='226.912µs' exec='chef-client'`

When you actually send the event - the logs will show this - and the event will fire:

`stdin='[{"ID":"long-semi-random-uuid-goes-here","Name":"chef-client","Payload":null,"NodeFilter":"","ServiceFilter":"service-name","TagFilter":"consul-server","Version":1,"LTime":1137}]' exec='chef-client'`
```
decoded event='chef-client' ltime='1137'
key='sifter/chef-client/i-c972d41e' value='1137'
location='complete' elapsed='47.448987142s' exec='chef-client'
```

Afterwards - if it sees the same event:

`location='duplicate' elapsed='8.269276ms' exec='chef-client'`

This is just an hour long hack - it doesn't do much - just wanted to see if this would work.

0 comments on commit f9f0057

Please sign in to comment.