Fix vet issues (#3396)
* internal/wrr: fix copying lock * internal/transport: don't use unkeyed fields * xds/internal/balancer/edsbalancer: don't use unkeyed fields * profiling/cmd: don't discard cancel
This commit is contained in:
@ -338,7 +338,7 @@ func (ht *serverHandlerTransport) HandleStreams(startStream func(*Stream), trace
|
||||
Addr: ht.RemoteAddr(),
|
||||
}
|
||||
if req.TLS != nil {
|
||||
pr.AuthInfo = credentials.TLSInfo{State: *req.TLS, CommonAuthInfo: credentials.CommonAuthInfo{credentials.PrivacyAndIntegrity}}
|
||||
pr.AuthInfo = credentials.TLSInfo{State: *req.TLS, CommonAuthInfo: credentials.CommonAuthInfo{SecurityLevel: credentials.PrivacyAndIntegrity}}
|
||||
}
|
||||
ctx = metadata.NewIncomingContext(ctx, ht.headerMD)
|
||||
s.ctx = peer.NewContext(ctx, pr)
|
||||
|
@ -61,7 +61,7 @@ func (pq *edfPriorityQueue) Pop() interface{} {
|
||||
}
|
||||
|
||||
// Current time in EDF scheduler.
|
||||
func (edf edfWrr) currentTime() float64 {
|
||||
func (edf *edfWrr) currentTime() float64 {
|
||||
if len(edf.items) == 0 {
|
||||
return 0.0
|
||||
}
|
||||
|
@ -73,7 +73,9 @@ func retrieveSnapshot(ctx context.Context, c ppb.ProfilingClient, f string) erro
|
||||
func remoteCommand() error {
|
||||
ctx := context.Background()
|
||||
if *flagTimeout > 0 {
|
||||
ctx, _ = context.WithTimeout(context.Background(), time.Duration(*flagTimeout)*time.Second)
|
||||
var cancel func()
|
||||
ctx, cancel = context.WithTimeout(context.Background(), time.Duration(*flagTimeout)*time.Second)
|
||||
defer cancel()
|
||||
}
|
||||
|
||||
grpclog.Infof("dialing %s", *flagAddress)
|
||||
|
@ -557,9 +557,9 @@ func buildPickerAndState(m map[internal.Locality]*pickerState) balancer.State {
|
||||
aggregatedState = connectivity.TransientFailure
|
||||
}
|
||||
if aggregatedState == connectivity.TransientFailure {
|
||||
return balancer.State{aggregatedState, base.NewErrPickerV2(balancer.ErrTransientFailure)}
|
||||
return balancer.State{ConnectivityState: aggregatedState, Picker: base.NewErrPickerV2(balancer.ErrTransientFailure)}
|
||||
}
|
||||
return balancer.State{aggregatedState, newPickerGroup(readyPickerWithWeights)}
|
||||
return balancer.State{ConnectivityState: aggregatedState, Picker: newPickerGroup(readyPickerWithWeights)}
|
||||
}
|
||||
|
||||
// RandomWRR constructor, to be modified in tests.
|
||||
|
Reference in New Issue
Block a user