jack-moseley commented on a change in pull request #2924: [GOBBLIN-1084] 
Refresh flowgraph when templates are modified
URL: https://github.com/apache/incubator-gobblin/pull/2924#discussion_r392850365
 
 

 ##########
 File path: 
gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitFlowGraphMonitor.java
 ##########
 @@ -128,11 +131,15 @@ public boolean shouldPollGit() {
    */
   @Override
   void processGitConfigChanges() throws GitAPIException, IOException {
-    if (flowTemplateCatalog.isPresent() && (flowTemplateCatalog.get() 
instanceof ObservingFSFlowEdgeTemplateCatalog)) {
-      ObservingFSFlowEdgeTemplateCatalog catalog = 
(ObservingFSFlowEdgeTemplateCatalog) flowTemplateCatalog.get();
-      if (catalog.isShouldRefreshFlowGraph()) {
-        this.gitRepo.initRepository();
-        catalog.setShouldRefreshFlowGraph(false);
+    if (lock.tryLock()) {
 
 Review comment:
   Hmm okay that's what I was thinking but I'm a bit confused what the 
concurrency issue is then. I guess the problem is that this variable could be 
modified from both git monitor and catalog at the same time?
   
   In that case it should work to modify the `setShouldRefreshFlowGraph` in 
catalog to acquire the same rwlock right?

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

Reply via email to