Skip to content

Commit

Permalink
etcdserver: Fix internal stringer merge for backport of 'took too lon…
Browse files Browse the repository at this point in the history
…g' warnings
  • Loading branch information
jpbetz committed Jun 12, 2018
1 parent 4db8b94 commit 5c6f444
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions etcdserver/.#v3_server.go
4 changes: 2 additions & 2 deletions etcdserver/etcdserverpb/raft_internal_stringer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (as *InternalRaftStringer) String() string {
case as.Request.Txn != nil:
return fmt.Sprintf("header:<%s> txn:<%s>",
as.Request.Header.String(),
newLoggableTxnRequest(as.Request.Txn).String(),
NewLoggableTxnRequest(as.Request.Txn).String(),
)
default:
// nothing to redact
Expand All @@ -78,7 +78,7 @@ type txnRequestStringer struct {
Request *TxnRequest
}

func newLoggableTxnRequest(request *TxnRequest) *txnRequestStringer {
func NewLoggableTxnRequest(request *TxnRequest) *txnRequestStringer {
return &txnRequestStringer{request}
}

Expand Down
3 changes: 2 additions & 1 deletion etcdserver/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ func warnOfExpensiveRequest(now time.Time, reqStringer fmt.Stringer, respMsg pro
warnOfExpensiveGenericRequest(now, reqStringer, "", resp, err)
}

func warnOfExpensiveReadOnlyTxnRequest(now time.Time, reqStringer fmt.Stringer, txnResponse *pb.TxnResponse, err error) {
func warnOfExpensiveReadOnlyTxnRequest(now time.Time, r *pb.TxnRequest, txnResponse *pb.TxnResponse, err error) {
reqStringer := pb.NewLoggableTxnRequest(r)
var resp string
if !isNil(txnResponse) {
var resps []string
Expand Down

0 comments on commit 5c6f444

Please sign in to comment.