You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2021/06/21 23:52:58 UTC

[GitHub] [gobblin] jack-moseley opened a new pull request #3318: [GOBBLIN-1478] Fix concurrency issue when iterating failedDagIds

jack-moseley opened a new pull request #3318:
URL: https://github.com/apache/gobblin/pull/3318


   Dear Gobblin maintainers,
   
   Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
   
   
   ### JIRA
   - [x] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
       - https://issues.apache.org/jira/browse/GOBBLIN-1478
   
   
   ### Description
   - [x] Here are some details about my PR, including screenshots (if applicable):
   
   `failedDagIds` is a `synchronizedSet`, but as per [the doc](https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#synchronizedSet(java.util.Set)), it is still not thread safe to iterate over it which the retention thread does, so we saw concurrent modification exceptions related to this. This PR fixes it by creating a copy set and iterating that instead.
   
   
   ### Tests
   - [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   
   
   ### Commits
   - [x] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
       1. Subject is separated from body by a blank line
       2. Subject is limited to 50 characters
       3. Subject does not end with a period
       4. Subject uses the imperative mood ("add", not "adding")
       5. Body wraps at 72 characters
       6. Body explains "what" and "why", not "how"
   
   


-- 
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:
users@infra.apache.org



[GitHub] [gobblin] jack-moseley commented on pull request #3318: [GOBBLIN-1478] Fix concurrency issue when iterating failedDagIds

Posted by GitBox <gi...@apache.org>.
jack-moseley commented on pull request #3318:
URL: https://github.com/apache/gobblin/pull/3318#issuecomment-866386556


   @sv2000 please merge


-- 
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:
users@infra.apache.org



[GitHub] [gobblin] asfgit closed pull request #3318: [GOBBLIN-1478] Fix concurrency issue when iterating failedDagIds

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3318:
URL: https://github.com/apache/gobblin/pull/3318


   


-- 
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:
users@infra.apache.org



[GitHub] [gobblin] arjun4084346 commented on a change in pull request #3318: [GOBBLIN-1478] Fix concurrency issue when iterating failedDagIds

Posted by GitBox <gi...@apache.org>.
arjun4084346 commented on a change in pull request #3318:
URL: https://github.com/apache/gobblin/pull/3318#discussion_r657327595



##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java
##########
@@ -1275,20 +1275,18 @@ public void run() {
       try {
         log.info("Cleaning failed dag state store");
         long startTime = System.currentTimeMillis();
-        List<String> dagIdsToClean = new ArrayList<>();
+        int numCleaned = 0;
 
-        for (String dagId : this.failedDagIds) {
+        Set<String> failedDagIdsCopy = new HashSet<>(this.failedDagIds);

Review comment:
       as per the [doc](https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#synchronizedSet(java.util.Set)) , `synchronized` could have been used.




-- 
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:
users@infra.apache.org