RockteMQ-AI commented on issue #3043: URL: https://github.com/apache/rocketmq-dashboard/issues/3043#issuecomment-5529240932
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** The reported issue has been verified against the current codebase (commit `1196e712` on `pr-2533-review`, which introduced the shared-deadline change in #2525). **Root Cause:** Two concrete problems in `InstanceService.fillCountsInParallel()`: 1. **Late mutation race** — `fillCounts(InstanceVO)` mutates the response object directly from worker threads (`setTopicCount`, `setConsumerGroupCount`, `setResourceCountsAvailable(true)`). After `invokeAll` expires the shared deadline, the main thread sets `setResourceCountsAvailable(false)` and returns the list. However, if a cloud SDK ignores `Future.cancel(true)` (common for in-flight HTTP requests), the worker continues running and can later call `setResourceCountsAvailable(true)` on the already-returned object — silently flipping the row back to "available" with potentially stale counts after the caller has already received the response. 2. **Unbounded executor queue** — `Executors.newFixedThreadPool(COUNT_PARALLELISM)` uses an unbounded `LinkedBlockingQueue`. Repeated or concurrent `listInstances` calls can enqueue unbounded tasks behind slow providers, including jobs whose callers have already timed out. **Impact:** Data integrity (response objects mutated after being returned to the caller), potential memory pressure under load. **Severity:** Medium — requires slow cloud providers or high concurrency to trigger, but the mutation-after-return pattern is a correctness violation. **Suggested direction** (aligns with the issue's expected behavior): - Have count tasks return detached result values instead of mutating `InstanceVO` in-place - Only apply results that completed within the batch deadline - Replace `newFixedThreadPool` with a bounded-queue executor; reject or degrade to unavailable when saturated - Check `Thread.interrupted()` inside `fillCounts` before mutating, and guard late mutations with a completion flag or per-row `AtomicBoolean` An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation, `/revise` to adjust the approach, or `/reject` to decline. --- *Automated evaluation by github-manager* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
