ibuenros commented on a change in pull request #2624: [GOBBLIN-760] Improve
retrying behavior of throttling client, add more informative …
URL: https://github.com/apache/incubator-gobblin/pull/2624#discussion_r280128758
##########
File path:
gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-client/src/main/java/org/apache/gobblin/util/limiter/BatchedPermitsRequester.java
##########
@@ -196,18 +205,26 @@ private long elapsedMillis(long startTimeNanos) {
/**
* Send a new permit request to the server.
*/
- private void maybeSendNewPermitRequest() {
- if (!this.requestSemaphore.tryAcquire()) {
- return;
+ private synchronized void maybeSendNewPermitRequest() {
+ while (!this.requestSemaphore.tryAcquire()) {
+ if (this.currentCallback == null) {
+ throw new IllegalStateException("Semaphore is unavailable while
callback is null!");
+ }
+ if (this.currentCallback.elapsedTime() > 30000) {
Review comment:
It is not actually derived from that, it's an arbitrary number. Added some
comments and logs though.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services