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

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

                Author: ASF GitHub Bot
            Created on: 19/Oct/21 01:28
            Start Date: 19/Oct/21 01:28
    Worklog Time Spent: 10m 
      Work Description: phet commented on a change in pull request #3415:
URL: https://github.com/apache/gobblin/pull/3415#discussion_r731425354



##########
File path: 
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java
##########
@@ -984,15 +985,16 @@ private void checkQuota(DagNode<JobExecutionPlan> 
dagNode) throws IOException {
       }
 
       if (!requesterCheck) {
-        throw new IOException(requesterMessage);
+        throw new IOException(requesterMessage.toString());
       }
     }
 
     /**
      * Increment quota by one for the given map and key.
+     * We need synchronization on this method because quotaMap is shared among 
all the {@link DagManagerThread}s.
      * @return true if quota is not reached for this user or user is 
whitelisted, false otherwise.
      */
-    private boolean incrementMapAndCheckQuota(Map<String, Integer> quotaMap, 
String user, DagNode<JobExecutionPlan> dagNode) {
+    synchronized private boolean incrementMapAndCheckQuota(Map<String, 
Integer> quotaMap, String user, DagNode<JobExecutionPlan> dagNode) {

Review comment:
       minor: but what do you think of the name 
`incrementJobCountAndCheckUserQuota`?




-- 
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: 666643)
    Time Spent: 0.5h  (was: 20m)

> 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: 0.5h
>  Remaining Estimate: 0h
>




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

Reply via email to