|
36 | 36 | errNonZeroSeqNo = xerrors.Wrap(errors.New("ydb: non zero seqno for auto set seqno mode")) //nolint:lll |
37 | 37 | errNonZeroCreatedAt = xerrors.Wrap(errors.New("ydb: non zero Message.CreatedAt and set auto fill created at option")) //nolint:lll |
38 | 38 | errNoAllowedCodecs = xerrors.Wrap(errors.New("ydb: no allowed codecs for write to topic")) |
39 | | - errLargeMessage = xerrors.Wrap(errors.New("ydb: message uncompressed size more, then limit")) //nolint:lll |
| 39 | + errLargeMessage = xerrors.Wrap(errors.New("ydb: message uncompressed size more, then limit")) //nolint:lll |
| 40 | + PublicErrQueueIsFull = xerrors.Wrap(errors.New("ydb: queue is full")) |
40 | 41 | PublicErrMessagesPutToInternalQueueBeforeError = xerrors.Wrap(errors.New("ydb: the messages was put to internal buffer before the error happened. It mean about the messages can be delivered to the server")) //nolint:lll |
41 | 42 | errDiffetentTransactions = xerrors.Wrap(errors.New("ydb: internal writer has messages from different trasactions. It is internal logic error, write issue please: https://github.com/ydb-platform/ydb-go-sdk/issues/new?assignees=&labels=bug&projects=&template=01_BUG_REPORT.md&title=bug%3A+")) //nolint:lll |
42 | 43 |
|
@@ -223,16 +224,18 @@ func (w *WriterReconnector) Write(ctx context.Context, messages []PublicMessage) |
223 | 224 | semaphoreWeight := int64(len(messages)) |
224 | 225 | if semaphoreWeight > int64(w.cfg.MaxQueueLen) { |
225 | 226 | return xerrors.WithStackTrace(fmt.Errorf( |
226 | | - "ydb: add more messages, then max queue limit. max queue: %v, try to add: %v", |
| 227 | + "ydb: add more messages, then max queue limit. max queue: %v, try to add: %v: %w", |
227 | 228 | w.cfg.MaxQueueLen, |
228 | 229 | semaphoreWeight, |
| 230 | + PublicErrQueueIsFull, |
229 | 231 | )) |
230 | 232 | } |
231 | 233 | if err := w.semaphore.Acquire(ctx, semaphoreWeight); err != nil { |
232 | 234 | return xerrors.WithStackTrace( |
233 | | - fmt.Errorf("ydb: add new messages exceed max queue size limit. Add count: %v, max size: %v", |
| 235 | + fmt.Errorf("ydb: add new messages exceed max queue size limit. Add count: %v, max size: %v: %w", |
234 | 236 | semaphoreWeight, |
235 | 237 | w.cfg.MaxQueueLen, |
| 238 | + PublicErrQueueIsFull, |
236 | 239 | )) |
237 | 240 | } |
238 | 241 | defer func() { |
|
0 commit comments