[ 
https://issues.apache.org/jira/browse/GOBBLIN-724?focusedWorklogId=224713&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-224713
 ]

ASF GitHub Bot logged work on GOBBLIN-724:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Apr/19 00:37
            Start Date: 09/Apr/19 00:37
    Worklog Time Spent: 10m 
      Work Description: autumnust commented on pull request #2591: 
[GOBBLIN-724] Upgrade throttling server so waiting until tokens can be used is 
doneā€¦
URL: https://github.com/apache/incubator-gobblin/pull/2591#discussion_r273281669
 
 

 ##########
 File path: gobblin-utility/src/main/java/org/apache/gobblin/util/Sleeper.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.util;
+
+import java.util.LinkedList;
+import java.util.Queue;
+
+import lombok.Getter;
+
+
+/**
+ * A class surrounding {@link Thread#sleep(long)} that allows mocking sleeps 
during testing.
+ */
+public class Sleeper {
+
+       /**
+        * A mock version of {@link Sleeper} that just register calls to sleep 
but returns immediately.
+        */
+       @Getter
+       public static class MockSleeper extends Sleeper {
+               private Queue<Long> requestedSleeps = new LinkedList<>();
 
 Review comment:
   indentation seems to be wrong in this file
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 224713)
    Time Spent: 0.5h  (was: 20m)

> Throttling server delays responses for throttling causing too many connections
> ------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-724
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-724
>             Project: Apache Gobblin
>          Issue Type: Bug
>            Reporter: Issac Buenrostro
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently, the throttling server implements throttling in part by delaying 
> the response with the permit allocation. However, when waiting to respond, 
> the request remains in flight utilizing system resources and severely 
> limiting how many clients can use the throttling server.
> As a fix, the server should respond immediately and ask the client to wait 
> before distributing the permits.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to