Repository navigation
MCP-684 Bound parallel organization entitlement checks - #728
Conversation
Co-Authored-By: Fabrik <fabrik@sonar.ai>
561d309 to
ce824a8
Compare
vnaskos-sonar
left a comment
There was a problem hiding this comment.
Review: MCP-684
It meets all of MCP-684's acceptance criteria, and I found nothing blocking. The FutureTask change, which stops network calls running under map locks, is a good fix.
Optional: OrgFeatureEntitlements.java:81 creates non-daemon threads (I checked). If the process exits while leftover checks are running, the JVM waits for them, bounded by the HTTP timeouts. Adding .daemon(true) is a one-line fix.
|
Code Review ✅ Approved 🟡 Medium risk 2 closed / 2 findingsParallelizing organization entitlement checks changes startup feature selection; a concurrent check failure could abort scanning before an eligible organization is discovered. Bounds the no-organization cloud startup entitlement scan to four concurrent checks, returning as soon as one organization qualifies. Resolved the ConcurrentHashMap computeIfAbsent serialization of parallel checks and the failure to cancel in-flight worker checks on interrupt during shutdown. No open issues found. ✅ 2 closed✅ Performance: Parallel checks still serialize on ConcurrentHashMap.computeIfAbsent locks
✅ Edge Case: Interrupt during shutdown does not cancel in-flight worker checks
Verification Rules 2/2 metFunctional validation No results Rules 2 passed 2 not applicable
Auto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |



MCP-684 https://sonarsource.atlassian.net/browse/MCP-684
Human description
Cloud startup can wait for each accessible organization in sequence when no organization is configured. Check up to four organizations concurrently and select Vortex as soon as one qualifies. Continue through every organization when none qualifies. Active checks finish and populate the session cache.
Agent description
Approach: A dedicated executor bounds concurrent combined entitlement checks at four. Completion-order processing avoids waiting for a slow earlier organization. No count cap or startup deadline changes tool availability. Existing fixed-organization, force-local, IDE, Server, HTTP/HTTPS, and toolset gates remain unchanged. Active requests can continue after selection; failed checks remain retryable.
Acceptance coverage: Tests cover the concurrency bound, early success without waiting for active checks, a late entitled organization, all-negative coverage, cache reuse, and failed-check retries. A controlled test compares twelve delayed 100 ms responses and requires the parallel scan to take less than 75% of sequential scan time.
Vortex: Project binding and context/agentic entitlement are enabled. Vortex supplied resource and interrupt-handling guidance. DEEP analysis raised one new boolean-expression finding, which was fixed. No changed-line findings remain. Existing SonarQubeMcpServer.java:219 java:S106 remains: "Replace this use of System.out by a logger."
Independent review: Clean, round 1, gpt-6.1-sol, zero blocking findings. Runtime validation in the restricted reviewer environment was unavailable because its Gradle distribution could not be downloaded.
Validation gaps: Docker integration tests were not run because the Docker daemon is unavailable; CI must cover them. Independent reviewer host preparation was not validated because repository guidance supplies no preparation plan. Its Gradle test and Spotless experiment could not run because services.gradle.org was unavailable in the restricted environment. Host ./gradlew build spotlessCheck passed in 12m 39s, including the full unit suite.
Repository guidance warning: The guidance helper reported a missing ADR directory. Adding repository guidance or seeding records is outside this change. Decision record: none changed.
Attachments used: none.
Usage: gpt-6.1-sol, 13,586,487 tokens at description preparation; review usage 749,909 tokens in one session, included in accounting.
This PR was opened as a draft by the autonomous fabrik. It may become ready only after its mechanical gates pass. Human approval and merge remain required.
🤖 Co-authored by Fabrik