Closed chemicL closed 5 years ago
Merging #102 into master will decrease coverage by
11.37%
. The diff coverage is18.44%
.
@@ Coverage Diff @@
## master #102 +/- ##
============================================
- Coverage 92.88% 81.5% -11.38%
- Complexity 150 157 +7
============================================
Files 19 25 +6
Lines 576 676 +100
Branches 48 49 +1
============================================
+ Hits 535 551 +16
- Misses 32 116 +84
Partials 9 9
Impacted Files | Coverage Δ | Complexity Δ | |
---|---|---|---|
...roxy/controlplane/server/limits/StreamLimiter.java | 0% <0%> (ø) |
0 <0> (?) |
|
...ontrolplane/server/limits/GuavaRequestLimiter.java | 0% <0%> (ø) |
0 <0> (?) |
|
.../controlplane/server/limits/ManualFlowControl.java | 0% <0%> (ø) |
0 <0> (?) |
|
...yproxy/controlplane/server/limits/FlowControl.java | 100% <100%> (ø) |
1 <1> (?) |
|
...xy/controlplane/server/limits/NoOpFlowControl.java | 100% <100%> (ø) |
4 <4> (?) |
|
...nvoyproxy/controlplane/server/DiscoveryServer.java | 81.36% <34.21%> (-14.67%) |
15 <1> (+1) |
|
...controlplane/server/limits/NoOpRequestLimiter.java | 50% <50%> (ø) |
1 <1> (?) |
|
... and 3 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 8e19277...d3ee1fb. Read the comment docs.
@snowp thanks for having a look and for your remarks. I addressed your requests and updated the PR. Please do let me know what's your view on the server interceptor and if anything else needs changes.
I just rebased with master to resolve conflicts in imports.
I'm closing this PR, more details here: https://github.com/envoyproxy/java-control-plane/issues/101#issuecomment-527449648
As described in #101 – I'm suggesting adding a DDoS prevention layer and this is an attempt to address this issue.
The work done here is partly based on the example implementation of manual flow control in grpc-java.
I tried making everything customizable and pluggable. The existing usages of
java-control-plane
should not be affected by these changes and will be available upon using classes in thelimits
package as depicted inTestLimits
runner.To perform load tests I used ghz. Here is the configuration and a run command:
ghz -config java-control-plane-loadtest.json
To run this, I copied over the
proto
folder into my testing directory.What this configuration does:
With the
TestLimits
configuration ofThis test takes around 30s to finish and results in 15 streams not being handled.
ghz's output:
Regarding code coverage. I tried doing my best, but due to the nature of
ServerCallStreamObserver
and the hidden default implementation, mocking it would miss the point in my opinion. When it comes to the part of limiting concurrently open streams, I tried depicting it inTestLimits
runner and providing a load test configuration. I'm open to suggestions if you have better ideas for automated tests that I can add.Fixes #101