Skip to content

Commit e825cab

Browse files
committed
Default timeout for topic writer connection is infinite
1 parent 72000e0 commit e825cab

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Changed default StartTime (time of retries for connect to server) for topic writer from 1 minute to infinite (can be overrided by WithWriterStartTimeout topic option)
12
* Added `Struct` support for `Variant` in `ydb.ParamsBuilder()`
23

34
## v3.61.2

internal/topic/retriable_error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
const (
16-
DefaultStartTimeout = time.Minute
16+
DefaultStartTimeout = value.InfiniteDuration
1717
connectionEstablishedTimeout = time.Minute
1818
)
1919

internal/topic/topicwriterinternal/writer_reconnector.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,8 @@ func (w *WriterReconnector) connectionLoop(ctx context.Context) {
380380
prevAttemptTime = now
381381

382382
if reconnectReason != nil {
383-
if backoff, retry := topic.CheckRetryMode(reconnectReason, w.retrySettings, w.clock.Since(startOfRetries)); retry {
383+
retryDuration := w.clock.Since(startOfRetries)
384+
if backoff, retry := topic.CheckRetryMode(reconnectReason, w.retrySettings, retryDuration); retry {
384385
delay := backoff.Delay(attempt)
385386
select {
386387
case <-doneCtx:
@@ -389,7 +390,7 @@ func (w *WriterReconnector) connectionLoop(ctx context.Context) {
389390
// pass
390391
}
391392
} else {
392-
_ = w.close(ctx, reconnectReason)
393+
_ = w.close(ctx, fmt.Errorf("%w, was retried (%v)", reconnectReason, retryDuration))
393394

394395
return
395396
}

0 commit comments

Comments
 (0)