-
Notifications
You must be signed in to change notification settings - Fork 565
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
Feat: Add endpoint to configure and get flow control #19409
base: main
Are you sure you want to change the base?
Feat: Add endpoint to configure and get flow control #19409
Conversation
For this test the set and get method are using different decoders, for which I think the easiest solution is to use two different Feign actuators with an abstraction in between, I was not able to find something more simple or elegant.
434bda8
to
f3f1c97
Compare
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.
Nice work @rodrigo-lourenco-lopes 🥇
I have a couple of suggestions and things I'd like to see changed but nothing major 🎉
dist/src/main/java/io/camunda/zeebe/shared/management/FlowControlEndpoint.java
Outdated
Show resolved
Hide resolved
zeebe/qa/util/src/main/java/io/camunda/zeebe/qa/util/actuator/SetFlowControlActuator.java
Outdated
Show resolved
Hide resolved
dist/src/main/java/io/camunda/zeebe/shared/management/FlowControlServiceImpl.java
Outdated
Show resolved
Hide resolved
...roker/src/main/java/io/camunda/zeebe/broker/system/partitions/ZeebePartitionAdminAccess.java
Outdated
Show resolved
Hide resolved
zeebe/protocol-impl/src/main/java/io/camunda/zeebe/protocol/impl/encoding/AdminRequest.java
Outdated
Show resolved
Hide resolved
zeebe/logstreams/src/main/java/io/camunda/zeebe/logstreams/impl/flowcontrol/FlowControl.java
Outdated
Show resolved
Hide resolved
zeebe/protocol-impl/src/main/java/io/camunda/zeebe/protocol/impl/encoding/AdminRequest.java
Outdated
Show resolved
Hide resolved
zeebe/protocol-impl/src/main/java/io/camunda/zeebe/protocol/impl/encoding/AdminResponse.java
Outdated
Show resolved
Hide resolved
...qa/integration-tests/src/test/java/io/camunda/zeebe/it/management/FlowControlEndpointIT.java
Outdated
Show resolved
Hide resolved
...qa/integration-tests/src/test/java/io/camunda/zeebe/it/management/FlowControlEndpointIT.java
Show resolved
Hide resolved
7d361c4
to
8bc87bf
Compare
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.
Updating my review to reflect the current state:
❌ The actuator endpoints should respond with content type application/json
.
zeebe/protocol-impl/src/main/java/io/camunda/zeebe/protocol/impl/encoding/AdminRequest.java
Outdated
Show resolved
Hide resolved
zeebe/protocol-impl/src/main/java/io/camunda/zeebe/protocol/impl/encoding/AdminResponse.java
Outdated
Show resolved
Hide resolved
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.
❌ the actuator is still responding in plain text:
curl -v localhost:9600/actuator/flowControl
* Host localhost:9600 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
* Trying [::1]:9600...
* Connected to localhost (::1) port 9600
> GET /actuator/flowControl HTTP/1.1
> Host: localhost:9600
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 200
< Content-Type: text/plain;charset=UTF-8
< Content-Length: 177
< Date: Tue, 02 Jul 2024 13:48:38 GMT
<
* Connection #0 to host localhost left intact
{"partitions":[{"flowControlConfig":"{REQUEST=com.netflix.concurrency.limits.limit.WindowedLimit@113ef35e, APPEND=VegasLimit [limit=1024, rtt_noload=0.0 ms]}","partitionId":1}]}
❌ The windowed limit is not serialized properly.
I think the serialization approach is not great overall, I'll take a look to try and find a way to make this look nice and maintainable.
Description
This pull request adds an endpoint to set and get the flow control configuration.
The get method returns the several flow control limits configured for each partition and broker.
The set method will use the configuration that we send in the payload in JSON to set the limits of all partitions in all brokers. To note that since the append limit cannot be null, if this is not present in the JSON payload or is set as null, then it will not be changed. In case the JSON is not parseable to the object FlowControl configuration, the error message will be return along with an example of a configuration.
Related issues
closes #18731