Skip to content

Commit 42cb6ca

Browse files
authored
ydb_topic write session: lower log level for retryable errors (#7038)
1 parent c05625d commit 42cb6ca

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

ydb/public/sdk/cpp/client/ydb_persqueue_public/impl/write_session_impl.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ TWriteSessionImpl::THandleResult TWriteSessionImpl::RestartImpl(const TPlainStat
9090
LOG_LAZY(DbDriverState->Log, TLOG_DEBUG, LogPrefix() << "Write session is aborting and will not restart");
9191
return result;
9292
}
93-
LOG_LAZY(DbDriverState->Log, TLOG_ERR,
94-
LogPrefix() << "Got error. Status: " << status.Status
95-
<< ". Description: " << IssuesSingleLineString(status.Issues)
96-
);
93+
9794
SessionEstablished = false;
9895
TMaybe<TDuration> nextDelay = TDuration::Zero();
9996
if (!RetryState) {
@@ -104,13 +101,11 @@ TWriteSessionImpl::THandleResult TWriteSessionImpl::RestartImpl(const TPlainStat
104101
if (nextDelay) {
105102
result.StartDelay = *nextDelay;
106103
result.DoRestart = true;
107-
LOG_LAZY(DbDriverState->Log,
108-
TLOG_DEBUG,
109-
LogPrefix() << "Write session will restart in " << result.StartDelay.MilliSeconds() << " ms"
110-
);
104+
LOG_LAZY(DbDriverState->Log, TLOG_INFO, LogPrefix() << "Got error. " << status.ToDebugString());
105+
LOG_LAZY(DbDriverState->Log, TLOG_INFO, LogPrefix() << "Write session will restart in " << result.StartDelay);
111106
ResetForRetryImpl();
112-
113107
} else {
108+
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Got error. " << status.ToDebugString());
114109
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Write session will not restart after a fatal error");
115110
result.DoStop = true;
116111
CheckHandleResultImpl(result);

ydb/public/sdk/cpp/client/ydb_topic/impl/write_session_impl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ TWriteSessionImpl::THandleResult TWriteSessionImpl::RestartImpl(const TPlainStat
163163
LOG_LAZY(DbDriverState->Log, TLOG_DEBUG, LogPrefix() << "Write session is aborting and will not restart");
164164
return result;
165165
}
166-
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Got error. " << status.ToDebugString());
167166
SessionEstablished = false;
168167

169168
// Keep DirectWriteToPartitionId value on temporary errors.
@@ -185,10 +184,11 @@ TWriteSessionImpl::THandleResult TWriteSessionImpl::RestartImpl(const TPlainStat
185184
if (nextDelay) {
186185
result.StartDelay = *nextDelay;
187186
result.DoRestart = true;
188-
LOG_LAZY(DbDriverState->Log, TLOG_WARNING, LogPrefix() << "Write session will restart in " << result.StartDelay);
187+
LOG_LAZY(DbDriverState->Log, TLOG_INFO, LogPrefix() << "Got error. " << status.ToDebugString());
188+
LOG_LAZY(DbDriverState->Log, TLOG_INFO, LogPrefix() << "Write session will restart in " << result.StartDelay);
189189
ResetForRetryImpl();
190-
191190
} else {
191+
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Got error. " << status.ToDebugString());
192192
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Write session will not restart after a fatal error");
193193
result.DoStop = true;
194194
CheckHandleResultImpl(result);

0 commit comments

Comments
 (0)