You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/03 00:51:12 UTC

[I] [BUG] AbstractLogCollector.initQueue() has thread-unsafe side effects on instance fields [shenyu]

Aias00 opened a new issue, #6656:
URL: https://github.com/apache/shenyu/issues/6656

   - severity: High
   - files: `shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-common/src/main/java/org/apache/shenyu/plugin/logging/common/collector/AbstractLogCollector.java:139-144`
   - description: `initQueue()` is called from `collect()` via `bufferQueueS.computeIfAbsent(...)`. Inside, instance fields `bufferSize` and `bufferQueue` are reassigned as side effects. Neither field is `volatile`. Multiple request threads calling `collect()` concurrently with different `selectorId`s race on these reassignments; non-volatile `bufferSize` may be stale when read at line 94 (`bufferQueue.size() < bufferSize`).
   - impact: Race on `bufferSize`/`bufferQueue` can cause incorrect capacity checks → premature log drops or `IllegalStateException`.
   - suggested_fix: Make `initQueue` return a holder (queue + capacity) instead of mutating shared instance fields.
   - confidence: High
   - related_existing: none
   
   ---
   _Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.md)._


-- 
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: notifications-unsubscribe@shenyu.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] AbstractLogCollector.initQueue() has thread-unsafe side effects on instance fields [shenyu]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed issue #6656: [BUG] AbstractLogCollector.initQueue() has thread-unsafe side effects on instance fields
URL: https://github.com/apache/shenyu/issues/6656


-- 
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: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] AbstractLogCollector.initQueue() has thread-unsafe side effects on instance fields [shenyu]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6656:
URL: https://github.com/apache/shenyu/issues/6656#issuecomment-5161212800

   👋 Hello @yuluo-yx
   
   A new issue has been opened by @Aias00:
   - **Title**: [BUG] AbstractLogCollector.initQueue() has thread-unsafe side effects on instance fields
   - **Link**: https://github.com/apache/shenyu/issues/6656
   
   Please review when you have time. Thank you! 🙏


-- 
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: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org