mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 09:14:17 -04:00
@@ -23,6 +23,7 @@ package xds
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/coredns/coredns/plugin/traffic/xds/bootstrap"
|
"github.com/coredns/coredns/plugin/traffic/xds/bootstrap"
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ func New(opts Options) (*Client, error) {
|
|||||||
c := &Client{
|
c := &Client{
|
||||||
opts: opts,
|
opts: opts,
|
||||||
cc: cc,
|
cc: cc,
|
||||||
v2c: newV2Client(cc, opts.Config.NodeProto, nil), // todo re-add backoff (exponential)
|
v2c: newV2Client(cc, opts.Config.NodeProto, func(int) time.Duration { return 0 }),
|
||||||
}
|
}
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ func (v2c *v2Client) run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if retries != 0 {
|
if retries != 0 {
|
||||||
t := time.NewTimer(1 * time.Second) // backoff bla bla.
|
t := time.NewTimer(v2c.backoff(retries))
|
||||||
select {
|
select {
|
||||||
case <-t.C:
|
case <-t.C:
|
||||||
case <-v2c.ctx.Done():
|
case <-v2c.ctx.Done():
|
||||||
@@ -165,6 +165,7 @@ func (v2c *v2Client) sendRequest(stream adsStream, resourceNames []string, typeU
|
|||||||
ResponseNonce: nonce,
|
ResponseNonce: nonce,
|
||||||
// TODO: populate ErrorDetails for nack.
|
// TODO: populate ErrorDetails for nack.
|
||||||
}
|
}
|
||||||
|
println("v2: sendrequest", typeURL)
|
||||||
if err := stream.Send(req); err != nil {
|
if err := stream.Send(req); err != nil {
|
||||||
log.Warningf("xds: request (type %s) for resource %v failed: %v", typeURL, resourceNames, err)
|
log.Warningf("xds: request (type %s) for resource %v failed: %v", typeURL, resourceNames, err)
|
||||||
return false
|
return false
|
||||||
@@ -180,6 +181,7 @@ func (v2c *v2Client) sendRequest(stream adsStream, resourceNames []string, typeU
|
|||||||
// quickly (once it pushes the message onto the transport layer) and is only
|
// quickly (once it pushes the message onto the transport layer) and is only
|
||||||
// ever blocked if we don't have enough flow control quota.
|
// ever blocked if we don't have enough flow control quota.
|
||||||
func (v2c *v2Client) sendExisting(stream adsStream) bool {
|
func (v2c *v2Client) sendExisting(stream adsStream) bool {
|
||||||
|
println("v2: sendexisting")
|
||||||
v2c.mu.Lock()
|
v2c.mu.Lock()
|
||||||
defer v2c.mu.Unlock()
|
defer v2c.mu.Unlock()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user