Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

stale records for short-lived containers #821

Closed
rade opened this issue Jun 2, 2015 · 1 comment
Closed

stale records for short-lived containers #821

rade opened this issue Jun 2, 2015 · 1 comment
Assignees
Milestone

Comments

@rade
Copy link
Member

rade commented Jun 2, 2015

When a container dies just before we tell DNS about it, we end up creating a stale record that is never removed. To reproduce, apply

--- a/weave
+++ b/weave
@@ -684,6 +684,8 @@ put_dns_fqdn() {
     FQDN="$2"
     shift 2

+    docker kill $CONTAINER_ID
+
     for ADDR in "$@" ; do
         http_call $DNS_CONTAINER_NAME $DNS_HTTP_PORT PUT /name/$CONTAINER_ID/${
     done

and then run

$ weave launch
$ weave launch-dns 10.2.1.1/24
$ weave run 10.2.0.1/24 -h foo.weave.local -ti ubuntu
$ weave status | grep "foo.weave.local"
51b239d2adc1: foo.weave.local.[10.2.0.1]

That last output is proof of the stale record.

@rade rade added this to the next milestone Jun 2, 2015
@rade
Copy link
Member Author

rade commented Jun 2, 2015

As with #819, the suggested fix is to check (using the docker api) whether the container is alive after adding it to the datastructure which is cleaned up by the docker event stream handler.

@inercia inercia self-assigned this Jun 5, 2015
@rade rade closed this as completed in #904 Jun 12, 2015
rade added a commit that referenced this issue Jun 12, 2015
Remove stale records for short-lived containers (bis)

Fixes #821. Replaces and hence closes #865.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants