e4c20ec190
Fix an issue where rpc_hold_timeout was being used as the timeout for non-blocking queries. Users should be able to tune read timeouts without fiddling with rpc_hold_timeout. A new configuration `rpc_read_timeout` is created. Refactor some implementation from the original PR 11500 to remove the misleading linkage between RPCInfo's timeout (used to retry in case of certain modes of failures) and the client RPC timeouts.
90 lines
2.8 KiB
Go
90 lines
2.8 KiB
Go
// Code generated by proto-gen-rpc-glue. DO NOT EDIT.
|
|
|
|
package pbpeering
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ structs.RPCInfo
|
|
var _ time.Month
|
|
|
|
// IsRead implements structs.RPCInfo
|
|
func (msg *PeeringReadRequest) IsRead() bool {
|
|
// TODO(peering): figure out read semantics here
|
|
return true
|
|
}
|
|
|
|
// AllowStaleRead implements structs.RPCInfo
|
|
func (msg *PeeringReadRequest) AllowStaleRead() bool {
|
|
// TODO(peering): figure out read semantics here
|
|
// TODO(peering): this needs to stay false for calls to head to the leader until we sync stream tracker information
|
|
// like ImportedServicesCount, ExportedServicesCount, as well as general Status fields thru raft to make available
|
|
// to followers as well
|
|
return false
|
|
}
|
|
|
|
// HasTimedOut implements structs.RPCInfo
|
|
func (msg *PeeringReadRequest) HasTimedOut(start time.Time, rpcHoldTimeout time.Duration, a time.Duration, b time.Duration) (bool, error) {
|
|
// TODO(peering): figure out read semantics here
|
|
return time.Since(start) > rpcHoldTimeout, nil
|
|
}
|
|
|
|
// SetTokenSecret implements structs.RPCInfo
|
|
func (msg *PeeringReadRequest) SetTokenSecret(s string) {
|
|
// TODO(peering): figure out read semantics here
|
|
}
|
|
|
|
// TokenSecret implements structs.RPCInfo
|
|
func (msg *PeeringReadRequest) TokenSecret() string {
|
|
// TODO(peering): figure out read semantics here
|
|
return ""
|
|
}
|
|
|
|
// Token implements structs.RPCInfo
|
|
func (msg *PeeringReadRequest) Token() string {
|
|
// TODO(peering): figure out read semantics here
|
|
return ""
|
|
}
|
|
|
|
// IsRead implements structs.RPCInfo
|
|
func (msg *PeeringListRequest) IsRead() bool {
|
|
// TODO(peering): figure out read semantics here
|
|
return true
|
|
}
|
|
|
|
// AllowStaleRead implements structs.RPCInfo
|
|
func (msg *PeeringListRequest) AllowStaleRead() bool {
|
|
// TODO(peering): figure out read semantics here
|
|
// TODO(peering): this needs to stay false for calls to head to the leader until we sync stream tracker information
|
|
// like ImportedServicesCount, ExportedServicesCount, as well as general Status fields thru raft to make available
|
|
// to followers as well
|
|
return false
|
|
}
|
|
|
|
// HasTimedOut implements structs.RPCInfo
|
|
func (msg *PeeringListRequest) HasTimedOut(start time.Time, rpcHoldTimeout time.Duration, a time.Duration, b time.Duration) (bool, error) {
|
|
// TODO(peering): figure out read semantics here
|
|
return time.Since(start) > rpcHoldTimeout, nil
|
|
}
|
|
|
|
// SetTokenSecret implements structs.RPCInfo
|
|
func (msg *PeeringListRequest) SetTokenSecret(s string) {
|
|
// TODO(peering): figure out read semantics here
|
|
}
|
|
|
|
// TokenSecret implements structs.RPCInfo
|
|
func (msg *PeeringListRequest) TokenSecret() string {
|
|
// TODO(peering): figure out read semantics here
|
|
return ""
|
|
}
|
|
|
|
// Token implements structs.RPCInfo
|
|
func (msg *PeeringListRequest) Token() string {
|
|
// TODO(peering): figure out read semantics here
|
|
return ""
|
|
}
|