Compare commits

...
3 Commits
4 changed files with 49 additions and 13 deletions

No files matched your search

+14
View File
@@ -1,3 +1,17 @@
## Release 0.11.2
This is a bug fix release, addressing the following issues:
- `weave run` did not respect DOCKER_CLIENT_ARGS. #855
- Negative result cache did not expire if requeried within TTL. #845
More details in the [change
log](https://github.com/weaveworks/weave/issues?q=milestone%3A0.11.2).
*NB: This release does not change the weave protocol version.
Therefore, when upgrading an existing 0.11 installation incrementally,
connectivity between peers will be retained.*
## Release 0.11.1 ## Release 0.11.1
This is a bug fix release, addressing the following issues: This is a bug fix release, addressing the following issues:
+16 -6
View File
@@ -5,13 +5,14 @@ import (
"container/heap" "container/heap"
"errors" "errors"
"fmt" "fmt"
"github.com/benbjohnson/clock"
"github.com/miekg/dns"
. "github.com/weaveworks/weave/common"
"math" "math"
"math/rand" "math/rand"
"sync" "sync"
"time" "time"
"github.com/benbjohnson/clock"
"github.com/miekg/dns"
. "github.com/weaveworks/weave/common"
) )
var ( var (
@@ -145,9 +146,12 @@ func (e *cacheEntry) setReply(reply *dns.Msg, ttl int, flags uint8, now time.Tim
prevValidUntil = e.validUntil prevValidUntil = e.validUntil
} }
e.Status = stResolved // make sure we do not overwrite noLocalReplies entries
e.Flags = flags if flags&CacheNoLocalReplies != 0 {
e.putTime = now if e.Flags&CacheNoLocalReplies != 0 {
return false
}
}
if ttl != nullTTL { if ttl != nullTTL {
e.validUntil = now.Add(time.Second * time.Duration(ttl)) e.validUntil = now.Add(time.Second * time.Duration(ttl))
@@ -161,8 +165,14 @@ func (e *cacheEntry) setReply(reply *dns.Msg, ttl int, flags uint8, now time.Tim
} }
} }
e.validUntil = now.Add(time.Second * time.Duration(minTTL)) e.validUntil = now.Add(time.Second * time.Duration(minTTL))
} else {
Warning.Printf("[cache] no valid TTL could be calculated")
} }
e.Status = stResolved
e.Flags = flags
e.putTime = now
if reply != nil { if reply != nil {
e.reply = *reply e.reply = *reply
e.ReplyLen = reply.Len() e.ReplyLen = reply.Len()
+18 -6
View File
@@ -2,13 +2,14 @@ package nameserver
import ( import (
"fmt" "fmt"
"net"
"testing"
"time"
"github.com/benbjohnson/clock" "github.com/benbjohnson/clock"
"github.com/miekg/dns" "github.com/miekg/dns"
. "github.com/weaveworks/weave/common" . "github.com/weaveworks/weave/common"
wt "github.com/weaveworks/weave/testing" wt "github.com/weaveworks/weave/testing"
"net"
"testing"
"time"
) )
// Check that the cache keeps its intended capacity constant // Check that the cache keeps its intended capacity constant
@@ -195,12 +196,23 @@ func TestCacheEntries(t *testing.T) {
question3 := &questionMsg3.Question[0] question3 := &questionMsg3.Question[0]
t.Logf("Checking that a entry with CacheNoLocalReplies return an error") t.Logf("Checking that a entry with CacheNoLocalReplies return an error")
l.Put(questionMsg3, nil, nullTTL, CacheNoLocalReplies) l.Put(questionMsg3, nil, negLocalTTL, CacheNoLocalReplies)
resp, err = l.Get(questionMsg3, minUDPSize) resp, err = l.Get(questionMsg3, minUDPSize)
wt.AssertNil(t, resp, "Get() response with CacheNoLocalReplies") wt.AssertNil(t, resp, "Get() response with CacheNoLocalReplies")
wt.AssertNotNil(t, err, "Get() error with CacheNoLocalReplies") wt.AssertTrue(t, err == errNoLocalReplies, "Get() error with CacheNoLocalReplies")
clk.Add(time.Second * time.Duration(negLocalTTL+1)) t.Logf("Checking that more Put's do not make the negative TTL longer")
clk.Add(time.Duration(negLocalTTL/2) * time.Second)
l.Put(questionMsg3, nil, negLocalTTL, CacheNoLocalReplies)
clk.Add(time.Duration(1) * time.Second)
l.Put(questionMsg3, nil, negLocalTTL, CacheNoLocalReplies)
clk.Add(time.Duration(1) * time.Second)
l.Put(questionMsg3, nil, negLocalTTL, CacheNoLocalReplies)
resp, err = l.Get(questionMsg3, minUDPSize)
wt.AssertNil(t, resp, "Get() response with CacheNoLocalReplies")
wt.AssertTrue(t, err == errNoLocalReplies, "Get() error with CacheNoLocalReplies")
clk.Add(time.Duration(negLocalTTL/2) * time.Second)
t.Logf("Checking that we get an expired response after %f seconds", negLocalTTL) t.Logf("Checking that we get an expired response after %f seconds", negLocalTTL)
resp, err = l.Get(questionMsg3, minUDPSize) resp, err = l.Get(questionMsg3, minUDPSize)
wt.AssertNil(t, resp, "expired Get() response with CacheNoLocalReplies") wt.AssertNil(t, resp, "expired Get() response with CacheNoLocalReplies")
+1 -1
View File
@@ -142,7 +142,7 @@ if [ "$1" = "run" ]; then
fi fi
collect_cidr_args "$@" collect_cidr_args "$@"
shift $CIDR_COUNT shift $CIDR_COUNT
CONTAINER=$(docker run $DNS_ARGS -d "$@") CONTAINER=$(docker $DOCKER_CLIENT_ARGS run $DNS_ARGS -d "$@")
exec_remote attach $CIDR_ARGS $CONTAINER exec_remote attach $CIDR_ARGS $CONTAINER
echo $CONTAINER echo $CONTAINER
exit 0 exit 0