Skip to content

Make YdbTransactionInterceptor wiring AOT-compatible#229

Merged
KirillKurdyukov merged 1 commit into
ydb-platform:mainfrom
Eistern:fix/aot-compatible-interceptor-wiring
Jul 14, 2026
Merged

Make YdbTransactionInterceptor wiring AOT-compatible#229
KirillKurdyukov merged 1 commit into
ydb-platform:mainfrom
Eistern:fix/aot-compatible-interceptor-wiring

Conversation

@Eistern

@Eistern Eistern commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

The replacer swapped Spring's transactionInterceptor bean for a YdbTransactionInterceptorFactory whose dependencies were supplied via setAutowireMode(AUTOWIRE_BY_TYPE). Spring's AOT engine runs the BeanDefinitionRegistryPostProcessor at build time and freezes the result into generated code, but it does not support the legacy autowire modes, so retryProperties/transactionAttributeSource were never injected. At runtime the factory's getObject() then failed with "retryProperties must be set...".

Issue Number: N/A

What is the new behavior?

Declare the two dependencies as explicit RuntimeBeanReference property values (resolved by type) instead. Explicit property values are code-generated by AOT and therefore survive, while JIT behavior is unchanged. The factory and post-processor are otherwise untouched.

The replacer swapped Spring's `transactionInterceptor` bean for a
YdbTransactionInterceptorFactory whose dependencies were supplied via
setAutowireMode(AUTOWIRE_BY_TYPE). Spring's AOT engine runs the
BeanDefinitionRegistryPostProcessor at build time and freezes the result
into generated code, but it does not support the legacy autowire modes,
so retryProperties/transactionAttributeSource were never injected. At
runtime the factory's getObject() then failed with
"retryProperties must be set...".

Declare the two dependencies as explicit RuntimeBeanReference property
values (resolved by type) instead. Explicit property values are
code-generated by AOT and therefore survive, while JIT behavior is
unchanged. The factory and post-processor are otherwise untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Eistern Eistern marked this pull request as ready for review July 13, 2026 13:16
@robot-vibe-db

robot-vibe-db Bot commented Jul 14, 2026

Copy link
Copy Markdown

@KirillKurdyukov Please set up your personal token, see instructions: https://nda.ya.ru/t/dur-L1y77biDC2

@robot-vibe-db robot-vibe-db Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI Review Summary

Verdict: ✅ No critical issues found

Critical issues

No critical issues found.

Other findings

  • Nit | Low: The 4-line block comment (lines 58–61) explaining why AUTOWIRE_BY_TYPE is replaced could be shortened to two lines, since the commit message already has the full rationale — spring-ydb-retry/src/main/java/tech/ydb/retry/YdbTransactionInterceptorReplacer.java:58

This review was generated automatically. Critical issues require attention; other findings are advisory.
If this comment was useful, please give it a 👍 — it helps us improve the review bot.

@robot-vibe-db

robot-vibe-db Bot commented Jul 14, 2026

Copy link
Copy Markdown

Full analysis log

Analysis performed by claude, claude-opus-4-6.

@KirillKurdyukov KirillKurdyukov merged commit a6c0a23 into ydb-platform:main Jul 14, 2026
4 checks passed
@KirillKurdyukov

Copy link
Copy Markdown
Collaborator

@Eistern hi!
You can use the 0.10.1 version with this fix!
Thanks for your contribution!

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.

2 participants