optimize(api): add warning logs for load-based request rejection by contrueCT · Pull Request #2972 · apache/hugegraph
Pull request overview
Adds operator-visible warning logs when LoadDetectFilter rejects requests due to high worker load or low free memory (503s), and introduces unit tests to cover the new rejection behavior plus whitelist/healthy pass-through.
Changes:
- Add
WARNlogging for worker-load and low-memory request rejections inLoadDetectFilter. - Add
LoadDetectFilterTestunit coverage for whitelist bypass, busy rejection, low-memory rejection, and healthy requests. - Register the new unit test in
UnitTestSuite.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/LoadDetectFilter.java | Adds rejection WARN logs and minor refactor (captures current load). |
| hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/unit/api/filter/LoadDetectFilterTest.java | New unit tests for whitelist/busy/low-memory/healthy scenarios. |
| hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/unit/UnitTestSuite.java | Adds LoadDetectFilterTest to the unit suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.