Skip to content

fix(types): не удерживать DocumentContext в кэше контрактов событий#4137

Merged
nixel2007 merged 1 commit into
developfrom
claude/event-contract-index-memory-lgil5p
Jun 16, 2026
Merged

fix(types): не удерживать DocumentContext в кэше контрактов событий#4137
nixel2007 merged 1 commit into
developfrom
claude/event-contract-index-memory-lgil5p

Conversation

@nixel2007

Copy link
Copy Markdown
Member

EventContractsIndex кэшировал значение как Lazy, supplier которого
(() -> buildFor(documentContext)) захватывал весь DocumentContext.
Lazy из io.github.1c-syntax:utils не обнуляет supplier после вычисления,
поэтому каждая запись держала сильную ссылку на DocumentContext вместе
с его SymbolTree (который clearSecondaryData не освобождает). В итоге
индекс, кэширующий крошечную карту «имя метода → контракт», пиннил
деревья символов всех проанализированных модулей.

computeIfAbsent сам откладывает вычисление до первого обращения и
выполняет buildFor однократно, поэтому Lazy здесь избыточен. Храним
готовую карту напрямую — захвата DocumentContext больше нет. buildFor
не реентрантен к contractsByUri, так что выполнение под bin-локом CHM
безопасно.

https://claude.ai/code/session_01UXaicRdUwd7Dm6Qfk8PA7K

EventContractsIndex кэшировал значение как Lazy, supplier которого
(`() -> buildFor(documentContext)`) захватывал весь DocumentContext.
Lazy из io.github.1c-syntax:utils не обнуляет supplier после вычисления,
поэтому каждая запись держала сильную ссылку на DocumentContext вместе
с его SymbolTree (который clearSecondaryData не освобождает). В итоге
индекс, кэширующий крошечную карту «имя метода → контракт», пиннил
деревья символов всех проанализированных модулей.

computeIfAbsent сам откладывает вычисление до первого обращения и
выполняет buildFor однократно, поэтому Lazy здесь избыточен. Храним
готовую карту напрямую — захвата DocumentContext больше нет. buildFor
не реентрантен к contractsByUri, так что выполнение под bin-локом CHM
безопасно.

https://claude.ai/code/session_01UXaicRdUwd7Dm6Qfk8PA7K
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nixel2007, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 1 minute and 51 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 175c5668-afdc-41ee-b293-3d68051a4792

📥 Commits

Reviewing files that changed from the base of the PR and between e9bcb35 and 325636f.

📒 Files selected for processing (1)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/types/index/EventContractsIndex.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/event-contract-index-memory-lgil5p

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nixel2007
nixel2007 force-pushed the claude/event-contract-index-memory-lgil5p branch from cb892c1 to 325636f Compare June 16, 2026 18:30
@sonarqubecloud

Copy link
Copy Markdown

@nixel2007
nixel2007 merged commit 6c985d8 into develop Jun 16, 2026
52 checks passed
@nixel2007
nixel2007 deleted the claude/event-contract-index-memory-lgil5p branch June 16, 2026 19:00
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