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

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

                Author: ASF GitHub Bot
            Created on: 04/Nov/21 22:09
            Start Date: 04/Nov/21 22:09
    Worklog Time Spent: 10m 
      Work Description: arjun4084346 commented on a change in pull request 
#3415:
URL: https://github.com/apache/gobblin/pull/3415#discussion_r743237710



##########
File path: 
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java
##########
@@ -960,49 +962,76 @@ private void checkQuota(DagNode<JobExecutionPlan> 
dagNode) throws IOException {
       String proxyUser = 
ConfigUtils.getString(dagNode.getValue().getJobSpec().getConfig(), 
AzkabanProjectConfig.USER_TO_PROXY, null);
       String specExecutorUri = DagManagerUtils.getSpecExecutorUri(dagNode);
       boolean proxyUserCheck = true;
+      int proxyQuotaIncrement;
+      Map<String, Integer> usersQuotaIncrement = new HashMap<>();
+      StringBuilder requesterMessage = new StringBuilder();
+
       if (proxyUser != null) {
-        proxyUserCheck = incrementMapAndCheckQuota(proxyUserToJobCount, 
proxyUser, dagNode);
+        proxyQuotaIncrement = 
incrementJobCountAndCheckUserQuota(proxyUserToJobCount, proxyUser, dagNode);
+        proxyUserCheck = proxyQuotaIncrement < 0;  // proxy user quota check 
failed
+        if (!proxyUserCheck) {
+          requesterMessage.append(String.format(
+              "Quota exceeded for proxy user %s on executor %s : quota=%s, 
runningJobs=%d%n",
+              proxyUser, specExecutorUri, getQuotaForUser(proxyUser),
+              
proxyUserToJobCount.get(DagManagerUtils.getUserQuotaKey(proxyUser, dagNode))));
+        }
       }
 
       String serializedRequesters = 
DagManagerUtils.getSerializedRequesterList(dagNode);
       boolean requesterCheck = true;
-      String requesterMessage = null;
+
       if (serializedRequesters != null) {
         for (ServiceRequester requester : 
RequesterService.deserialize(serializedRequesters)) {
-          requesterCheck &= incrementMapAndCheckQuota(requesterToJobCount, 
requester.getName(), dagNode);
-          if (!requesterCheck && requesterMessage == null) {
-            requesterMessage = "Quota exceeded for requester " + 
requester.getName() + " on executor " + specExecutorUri + ": quota="
-                + getQuotaForUser(requester.getName()) + ", runningJobs=" + 
requesterToJobCount.get(DagManagerUtils.getUserQuotaKey(requester.getName(), 
dagNode));
+          int userQuotaIncrement = 
incrementJobCountAndCheckUserQuota(requesterToJobCount, requester.getName(), 
dagNode);
+          boolean thisRequesterCheck;
+          thisRequesterCheck = userQuotaIncrement < 0;  // user quota check 
failed
+          usersQuotaIncrement.put(requester.getName(), 
Math.max(userQuotaIncrement, 0));

Review comment:
       good thought. it should be different. but again i do not have 100% 
confidence. will fix it




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 676759)
    Time Spent: 2h 20m  (was: 2h 10m)

> fix synchronization issue while using users job quota in DagManager in 
> gobblin service
> --------------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1564
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1564
>             Project: Apache Gobblin
>          Issue Type: Bug
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to