Skip to content

Allow null operationName in SessionRetryContext - #808

Merged
KirillKurdyukov merged 1 commit into
masterfrom
retry-nullable-operation-name
Dec 4, 2026
Merged

KirillKurdyukov merged 1 commit into
masterfrom
retry-nullable-operation-name

Conversation

@KirillKurdyukov

Copy link
Copy Markdown
Collaborator

Removed the non-null check of operationName in query and table SessionRetryContext: null means retry metrics are reported without the operation.name attribute.

@pnv1 pnv1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ИИ-ревью]

В Query и Table перегрузки supplyResult и supplyStatus теперь принимают null в качестве имени операции. В этом случае span получает имя ydb.RunWithRetry, а метрики повторных попыток записываются без атрибута operation.name.

Замечания (1)

* @return future with the status of the last attempt
*/
public CompletableFuture<Status> supplyStatus(String operationName,
public CompletableFuture<Status> supplyStatus(@Nullable String operationName,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion · Проверить явную передачу null в тестах Query и Table

Существующие тесты проверяют имя span и обе метрики через supplyStatus(fn). Они продолжат проходить, даже если в перегрузки с именем операции вернуть requireNonNull. Стоит добавить в обоих модулях вызовы supplyStatus(operationName, fn) и supplyResult(operationName, fn) с String operationName = null и проверить, что span получает имя ydb.RunWithRetry, а обе гистограммы записываются без operation.name.

В Table тип String также позволяет компилятору выбрать перегрузку: для литерала null подходит и вариант с SessionRetryHandler. Тест Query · Тест Table

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не стоит, методы без operationName передают null, тесты это проверяют

@KirillKurdyukov
KirillKurdyukov force-pushed the retry-nullable-operation-name branch from f572106 to 427da16 Compare December 4, 2026 08:45
@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.14%. Comparing base (0a2a16c) to head (427da16).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #808   +/-   ##
=========================================
  Coverage     76.14%   76.14%           
- Complexity     3888     3889    +1     
=========================================
  Files           399      399           
  Lines         17251    17249    -2     
  Branches       1825     1825           
=========================================
- Hits          13135    13134    -1     
  Misses         3494     3494           
+ Partials        622      621    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KirillKurdyukov
KirillKurdyukov merged commit 2f1ea5a into master Dec 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants