Skip to content

Commit 1a7ad8a

Browse files
committed
direct table trace for retry requests
1 parent 74d6cde commit 1a7ad8a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

internal/table/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ func (c *client) Do(ctx context.Context, op table.Operation, opts ...table.Optio
544544
retry.SlowBackoff,
545545
options.Idempotent,
546546
op,
547+
c.config.Trace(),
547548
)
548549
}
549550

internal/table/retry.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (f SessionProviderFunc) Put(ctx context.Context, s Session) error {
6868

6969
func (f SessionProviderFunc) Do(ctx context.Context, op table.Operation, opts ...table.Option) (err error) {
7070
if f.OnDo == nil {
71-
return retryBackoff(ctx, f, nil, nil, false, op)
71+
return retryBackoff(ctx, f, nil, nil, false, op, trace.ContextTable(ctx))
7272
}
7373
return f.OnDo(ctx, op)
7474
}
@@ -100,7 +100,7 @@ func (s *singleSession) Do(ctx context.Context, op table.Operation, opts ...tabl
100100
for _, o := range opts {
101101
o(&options)
102102
}
103-
return retryBackoff(ctx, s, s.b, s.b, options.Idempotent, op)
103+
return retryBackoff(ctx, s, s.b, s.b, options.Idempotent, op, trace.ContextTable(ctx))
104104
}
105105

106106
func (s *singleSession) Close(ctx context.Context) error {
@@ -144,13 +144,14 @@ func retryBackoff(
144144
slowBackoff retry.Backoff,
145145
isOperationIdempotent bool,
146146
op table.Operation,
147+
t trace.Table,
147148
) (err error) {
148149
var (
149150
s Session
150151
i int
151152
attempts int
152153
code = int32(0)
153-
onIntermediate = trace.TableOnPoolRetry(trace.ContextTable(ctx), ctx, isOperationIdempotent)
154+
onIntermediate = trace.TableOnPoolRetry(t, ctx, isOperationIdempotent)
154155
)
155156
defer func() {
156157
if s != nil {

0 commit comments

Comments
 (0)