kalayciburak opened a new pull request, #7496: URL: https://github.com/apache/shenyu/pull/7496
Fixes #7461 Seeded elements were enqueued by the collection constructor without a memory charge, so `take()` waited in `releaseInterruptibly` on an empty budget. `drainTo`, iterator removal, `removeIf`, `removeAll` and `retainAll` dropped elements without releasing their reservation, so a later `offer` could reject work on an empty queue. - Charge each seed after construction. If the seed does not fit, throw `IllegalStateException` and do not return the queue. - Release the reservation for every element removed by `drainTo` (both overloads), iterator `remove`, `removeIf`, `removeAll` and `retainAll`. - `drainTo` still rejects a null destination and `drainTo(this)`. A destination that throws still releases the drained reservation, so admission is not left stuck. Regression coverage is in `MemoryLimitedLinkedBlockingQueueAccountingTest`, separate from the open edit of `MemoryLimitedLinkedBlockingQueueTest`. ## Tests run - `JAVA_HOME=17 ./mvnw -pl shenyu-common test -Dtest=MemoryLimitedLinkedBlockingQueueAccountingTest -Djacoco.skip=true` — 9 run, 0 failed. Before the fix, seed charge was expected 16 and was 0; after `drainTo`, memory was expected 0 and was 32. - `./mvnw -pl shenyu-common test -Djacoco.skip=true` — 420 run, 0 failed, 1 skipped (`UpstreamCheckUtilsTest`). Checkstyle reported 0 violations. - `./mvnw -pl shenyu-common apache-rat:check` — unapproved 0. `./mvnw clean install -Dmaven.javadoc.skip=true` was not run. -- 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]
