Skip to content

Conversation

@nixel2007
Copy link
Member

@nixel2007 nixel2007 commented Jan 16, 2026

Описание

Связанные задачи

Closes

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Для диагностик

  • Описание диагностики заполнено для обоих языков (присутствуют файлы для обоих языков, для русского заполнено все подробно, перевод на английский можно опустить)

Дополнительно

Summary by CodeRabbit

  • Refactor
    • Enhanced document retrieval performance through optimized access patterns in reference indexing operations.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings January 16, 2026 08:18
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

A new unsynchronized document retrieval method getDocumentNoLock() is added to ServerContext for performance-critical scenarios where external synchronization is guaranteed. ReferenceIndex is updated to use this new method instead of the synchronized getDocument() call.

Changes

Cohort / File(s) Summary
Unsynchronized document access
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/ServerContext.java
Added public method getDocumentNoLock(URI uri) that bypasses locking mechanism and directly accesses the internal documents map. Method is annotated @Nullable with documentation restricting usage to scenarios with guaranteed external synchronization or when eventual consistency is acceptable.
ReferenceIndex lock optimization
src/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.java
Updated getFromSymbol() to call getDocumentNoLock(uri) instead of getDocument(uri), replacing the synchronized retrieval with unsynchronized access. Remaining fluent chain (symbolTree mapping and error handling) remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A rabbit speeds through locks unbounded,
No waiting queues, no threads compounded,
When safe to peek, performance grows,
Swift as the warren's fastest does! 🌙✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: fixing a deadlock during context initialization when a document is open at project startup. This matches the code changes which introduce a lock-free document retrieval method to address concurrency issues.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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
Copy link
Member Author

/buildJar

@github-actions
Copy link
Contributor

✅ Собраны JAR-файлы для этого PR по команде /buildJar.

Артефакт: 5151422564

Файлы внутри:

  • bsl-language-server-fix-startup-deadlock-7bde9bc-exec.jar

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.

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

@nixel2007 nixel2007 enabled auto-merge January 16, 2026 08:32
@nixel2007 nixel2007 disabled auto-merge January 16, 2026 08:33
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

Test Results

 2 907 files  ±0   2 907 suites  ±0   1h 1m 59s ⏱️ - 3m 28s
 1 227 tests ±0   1 227 ✅ ±0  0 💤 ±0  0 ❌ ±0 
11 043 runs  ±0  11 043 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 7bde9bc. ± Comparison against base commit 7e5f646.

@nixel2007 nixel2007 merged commit a02f38e into develop Jan 16, 2026
46 checks passed
@nixel2007 nixel2007 deleted the fix/startup-deadlock branch January 16, 2026 08:58
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