-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes updates to traffic shaping options with shared servers #5282
base: 4.x
Are you sure you want to change the base?
Conversation
This fixes the update-path for traffic shaping options to check for the existence of the traffic shaping handler only for the actual server.
…hey do not change This is especially relevant for shared servers, where we now 1) update the actual-server's options, and 2) only perform the update when the traffic options change.
src/test/java/io/vertx/core/http/HttpBandwidthLimitingTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/vertx/core/http/HttpBandwidthLimitingTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/vertx/core/http/HttpBandwidthLimitingTest.java
Outdated
Show resolved
Hide resolved
for (int i = 0; i < numEventLoops; i++) { | ||
servers.forEach(s -> s.updateTrafficShapingOptions(updatedTrafficOptions)); | ||
} | ||
startPromise.complete(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to complete the start promise with the result of updateTrafficShapingOptions to ensure proper sequentiality in the test and avoid races, e.g. using a CompositeFuture.all(...) with the future returned by the updates seems the easiest way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good point. updateTrafficShapingOptions is synchronous currently, but added steps to track those actions via promises that chains with the start promise.
Motivation:
This fixes the update-path for traffic shaping options to check for the existence of the traffic shaping handler only for the actual server. Currently, updating traffic-shaping options in a shared-server setting results in
IllegalStateException
, as the traffic-shaping handler is not set for the worker (non-main) servers.Conformance:
You should have signed the Eclipse Contributor Agreement as explained in https://github.com/eclipse/vert.x/blob/master/CONTRIBUTING.md
Please also make sure you adhere to the code style guidelines: https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines