Skip to content
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

Adds support for the reap lock. #1592

Merged
merged 1 commit into from
Jan 13, 2016
Merged

Adds support for the reap lock. #1592

merged 1 commit into from
Jan 13, 2016

Conversation

slackpad
Copy link
Contributor

This is the Consul side of hashicorp/consul-template#511. Unit tests look good as a regression - I will do some integrated testing in the morning, similar to what was done in the CT PR.

/cc @sethvargo

@slackpad
Copy link
Contributor Author

Did some testing with Docker. With a Consul 0.6.1 build I was able to get the busy loop problem to come up. Adding in the fix for that in go-reap, I then tried to get the "stolen wait" to happen, and was able to do so for watches, checks, and consul exec. For watches I got [ERR] agent: Failed to invoke watch handler '/tmp/zombie': wait: no child processes, for checks I got 2016/01/13 06:05:39 [WARN] agent: Check 'zombie' is now critical, and for consul exec I got it to spuriously report an exit code of 1.

Moving over to a build with this change, things worked well, even with multiple pokes. I could see the normal child process reaping messages in the logs.

Here's the Dockerfile I used:

FROM ubuntu
COPY bin/consul /tmp
COPY foo.json /tmp
COPY zombie /tmp
CMD ["/tmp/consul", "agent", "-dev", "-config-file=/tmp/foo.json"]

And the consul foo.json:

{
        "log_level": "debug",
        "bind_addr": "0.0.0.0",
        "check": {
                "id": "zombie",
                "name": "make a zombie",
                "script": "/tmp/zombie",
                "interval": "10s"
        },
        "watches": [
                {
                        "type": "key",
                        "key": "foo/bar",
                        "handler": "/tmp/zombie"
                }
        ]
}

The zombie program is the same as hashicorp/consul-template#511.

To fire the watch:

date | curl -X PUT localhost:8500/v1/kv/foo/bar

And to remote exec:

./tmp/consul exec /tmp/zombie

slackpad added a commit that referenced this pull request Jan 13, 2016
Adds support for the reap lock.
@slackpad slackpad merged commit 71e3901 into master Jan 13, 2016
@slackpad slackpad deleted the b-reap branch January 13, 2016 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant