Skip to content

Conversation

@nshestakov
Copy link
Collaborator

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

Copilot AI review requested due to automatic review settings December 4, 2025 14:19
@nshestakov nshestakov requested a review from a team as a code owner December 4, 2025 14:19
@nshestakov nshestakov requested a review from alexnick88 December 4, 2025 14:19
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

🟢 2025-12-04 14:20:20 UTC The validation of the Pull Request description is successful.

@ydbot
Copy link
Collaborator

ydbot commented Dec 4, 2025

Run Extra Tests

Run additional tests for this PR. You can customize:

  • Test Size: small, medium, large (default: all)
  • Test Targets: any directory path (default: ydb/)
  • Sanitizers: ASAN, MSAN, TSAN
  • Coredumps: enable for debugging (default: off)
  • Additional args: custom ya make arguments

▶  Run tests

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 14:21:24 UTC Pre-commit check linux-x86_64-relwithdebinfo for 51cc791 has started.
2025-12-04 14:21:43 UTC Artifacts will be uploaded here
2025-12-04 14:23:57 UTC ya make is running...
🟢 2025-12-04 15:50:30 UTC ydbd size 2.3 GiB changed* by -23.7 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: 18ecdce merge: 51cc791 diff diff %
ydbd size 2 463 956 400 Bytes 2 463 932 144 Bytes -23.7 KiB -0.001%
ydbd stripped size 524 487 328 Bytes 524 487 712 Bytes +384 Bytes +0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation
2025-12-04 15:50:31 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 14:21:31 UTC Pre-commit check linux-x86_64-release-asan for 51cc791 has started.
2025-12-04 14:21:49 UTC Artifacts will be uploaded here
2025-12-04 14:23:55 UTC ya make is running...
🟡 2025-12-04 15:34:00 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
11746 11653 0 60 19 14

🟢 2025-12-04 15:34:10 UTC Build successful.
🟢 2025-12-04 15:34:36 UTC ydbd size 3.8 GiB changed* by -34.5 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: 2201001 merge: 51cc791 diff diff %
ydbd size 4 123 223 272 Bytes 4 123 187 952 Bytes -34.5 KiB -0.001%
ydbd stripped size 1 531 161 400 Bytes 1 531 161 144 Bytes -256 Bytes -0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copilot finished reviewing on behalf of nshestakov December 4, 2025 14:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces Y_ABORT_UNLESS macro calls with AFL_ENSURE macro across multiple actor classes in the PersQueue service. The change aims to provide better exception handling and logging capabilities through the AFL_ENSURE macro which throws exceptions instead of aborting the process.

Key changes:

  • Added IActorExceptionHandler interface to actor classes to handle unhandled exceptions gracefully
  • Replaced all Y_ABORT_UNLESS calls with AFL_ENSURE calls across partition, commit offset, and direct read actors
  • Implemented OnUnhandledException methods that log exceptions and gracefully shut down actors
  • Refactored logging macros in actor.h to use a common NPQ_LOG_PREFIX define

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ydb/services/persqueue_v1/actors/partition_actor.h Added IActorExceptionHandler interface and OnUnhandledException method declaration
ydb/services/persqueue_v1/actors/partition_actor.cpp Replaced 84 instances of Y_ABORT_UNLESS with AFL_ENSURE and implemented exception handler
ydb/services/persqueue_v1/actors/direct_read_actor.h Added IActorExceptionHandler interface and OnUnhandledException method declaration
ydb/services/persqueue_v1/actors/direct_read_actor.cpp Replaced 7 instances of Y_ABORT_UNLESS with AFL_ENSURE and implemented exception handler
ydb/services/persqueue_v1/actors/commit_offset_actor.h Added IActorExceptionHandler interface and OnUnhandledException method declaration
ydb/services/persqueue_v1/actors/commit_offset_actor.cpp Replaced 5 instances of Y_ABORT_UNLESS with AFL_ENSURE and implemented exception handler
ydb/core/persqueue/common/actor.h Added DoLogUnhandledException function declaration and refactored logging macros
ydb/core/persqueue/common/actor.cpp Implemented DoLogUnhandledException helper function for centralized exception logging

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 15:52:23 UTC Pre-commit check linux-x86_64-release-asan for 71f1ac8 has started.
2025-12-04 15:52:47 UTC Artifacts will be uploaded here
2025-12-04 15:54:46 UTC ya make is running...
🟡 2025-12-04 16:55:11 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
11746 11666 0 63 7 10

🟢 2025-12-04 16:55:22 UTC Build successful.
🟢 2025-12-04 16:55:46 UTC ydbd size 3.8 GiB changed* by +3.7 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: e0e1624 merge: 71f1ac8 diff diff %
ydbd size 4 123 223 368 Bytes 4 123 227 168 Bytes +3.7 KiB +0.000%
ydbd stripped size 1 531 161 464 Bytes 1 531 176 888 Bytes +15.1 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 15:52:47 UTC Pre-commit check linux-x86_64-relwithdebinfo for 71f1ac8 has started.
2025-12-04 15:53:05 UTC Artifacts will be uploaded here
2025-12-04 15:55:12 UTC ya make is running...
🟡 2025-12-04 17:19:15 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
31957 30533 0 6 1400 18

2025-12-04 17:19:26 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-12-04 17:28:45 UTC Tests successful.

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
44 (only retried tests) 32 0 0 0 12

🟢 2025-12-04 17:28:52 UTC Build successful.
🟢 2025-12-04 17:29:17 UTC ydbd size 2.3 GiB changed* by -23.5 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: e5aed84 merge: 71f1ac8 diff diff %
ydbd size 2 463 975 824 Bytes 2 463 951 752 Bytes -23.5 KiB -0.001%
ydbd stripped size 524 491 232 Bytes 524 491 808 Bytes +576 Bytes +0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Comment on lines +146 to +150
NPQ::DoLogUnhandledException(NKikimrServices::PQ_READ_PROXY, "", exc);

this->Die(ActorContext());

return true;
Copy link
Collaborator

@ubyte ubyte Dec 4, 2025

Choose a reason for hiding this comment

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

А как мы узнаем, что что-то сломалось? Метрика числа исключений ведь не увидет, и падений тоже не будет.

IncrementUnhandledExceptionCounter звать может

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

обобщу в другом ПР


bool TPartitionActor::OnUnhandledException(const std::exception& exc) {
NPQ::DoLogUnhandledException(NKikimrServices::PQ_READ_PROXY, TStringBuilder() << "[" << Session <<"][" << Partition << "] ", exc);

Copy link
Collaborator

Choose a reason for hiding this comment

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

тоже до алерта дотянуть сигнал надо

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 18:06:23 UTC Pre-commit check linux-x86_64-relwithdebinfo for d3bb1e8 has started.
2025-12-04 18:06:42 UTC Artifacts will be uploaded here
2025-12-04 18:08:49 UTC ya make is running...
🟡 2025-12-04 19:34:23 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
31974 30539 0 2 1415 18

2025-12-04 19:34:34 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-12-04 19:42:36 UTC Tests successful.

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
36 (only retried tests) 22 0 0 0 14

🟢 2025-12-04 19:42:42 UTC Build successful.
🟢 2025-12-04 19:43:04 UTC ydbd size 2.3 GiB changed* by -13.8 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: 6f23970 merge: d3bb1e8 diff diff %
ydbd size 2 464 352 616 Bytes 2 464 338 504 Bytes -13.8 KiB -0.001%
ydbd stripped size 524 575 200 Bytes 524 577 632 Bytes +2.4 KiB +0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

2025-12-04 18:07:27 UTC Pre-commit check linux-x86_64-release-asan for d3bb1e8 has started.
2025-12-04 18:08:10 UTC Artifacts will be uploaded here
2025-12-04 18:10:12 UTC ya make is running...
🟡 2025-12-04 19:17:28 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
11748 11674 0 57 7 10

🟢 2025-12-04 19:17:37 UTC Build successful.
🟢 2025-12-04 19:18:00 UTC ydbd size 3.8 GiB changed* by -20.2 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: 6f23970 merge: d3bb1e8 diff diff %
ydbd size 4 124 042 048 Bytes 4 124 021 312 Bytes -20.2 KiB -0.001%
ydbd stripped size 1 531 491 064 Bytes 1 531 494 136 Bytes +3.0 KiB +0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants