{"action":"created","comment":{"url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/comments/39930736","id":39930736,"diff_hunk":"@@ -106,4 +123,75 @@ public void registerChildren(ManagementResourceRegistration resourceRegistration\n             resourceRegistration.registerSubModel(new IgnoredDomainTypeResourceDefinition());\n         }\n     }\n+\n+    public class IgnoredClonedProfileRegistry {\n+        private volatile Set<String> ignoredClonedProfiles = Collections.synchronizedSet(new HashSet<>());\n+        private volatile Set<String> currentTxIgnoredClonedProfiles;\n+        private volatile boolean reloadRequired;\n+\n+        private IgnoredClonedProfileRegistry() {\n+        }\n+\n+        public boolean checkIgnoredProfileClone(OperationContext context, ModelNode operation) {\n+            if (!localHostControllerInfo.isMasterDomainController()) {\n+                PathAddress addr = PathAddress.pathAddress(operation.get(OP_ADDR));\n+                if (addr.size() > 0) {\n+                    PathElement first = addr.getElement(0);\n+                    if (first.getKey().equals(PROFILE)) {\n+                        String name = operation.get(OP).asString();\n+                        if (name.equals(CLONE) && isResourceExcluded(addr)) {\n+                            //We are cloning an ignored profile, add the new profile to the runtime registry\n+                            //and make the host requires-reload\n+                            final String profileName = operation.get(TO_PROFILE).asString();\n+                            getIgnoredClonedProfiles(true).add(profileName);\n+                            context.reloadRequired();\n+                            reloadRequired = true;\n+                            return true;\n+                        } else if (name.equals(REMOVE) && addr.size() == 1) {\n+                            //We are removing a profile, remove it from the runtime registry if it is there\n+                            return getIgnoredClonedProfiles(true).remove(first.getValue());\n+                        }\n+                        //Ignore depending on if it is in the runtime registry\n+                        return getIgnoredClonedProfiles(false).contains(first.getValue());\n+                    }\n+                }\n+            }\n+            return false;\n+        }\n+\n+        public void initializeModelSync() {\n+            if (!localHostControllerInfo.isMasterDomainController()) {\n+                //We are resyncing the model, so clear the runtime registry\n+                getIgnoredClonedProfiles(true).clear();\n+            }\n+        }\n+\n+        public void complete(OperationContext context, boolean rollback) {\n+            if (!localHostControllerInfo.isMasterDomainController()) {\n+                if (!rollback) {\n+                    if (currentTxIgnoredClonedProfiles != null) {\n+                        ignoredClonedProfiles = currentTxIgnoredClonedProfiles;\n+                    }\n+                } else {\n+                    if (reloadRequired) {\n+                        context.revertReloadRequired();","path":"host-controller/src/main/java/org/jboss/as/host/controller/ignored/IgnoredDomainResourceRegistry.java","position":93,"original_position":93,"commit_id":"288ee5e27975345dc3e267ad54aa8cc09655a114","original_commit_id":"288ee5e27975345dc3e267ad54aa8cc09655a114","user":{"login":"bstansberry","id":299242,"avatar_url":"https://avatars.githubusercontent.com/u/299242?v=3","gravatar_id":"","url":"https://api.github.com/users/bstansberry","html_url":"https://github.com/bstansberry","followers_url":"https://api.github.com/users/bstansberry/followers","following_url":"https://api.github.com/users/bstansberry/following{/other_user}","gists_url":"https://api.github.com/users/bstansberry/gists{/gist_id}","starred_url":"https://api.github.com/users/bstansberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bstansberry/subscriptions","organizations_url":"https://api.github.com/users/bstansberry/orgs","repos_url":"https://api.github.com/users/bstansberry/repos","events_url":"https://api.github.com/users/bstansberry/events{/privacy}","received_events_url":"https://api.github.com/users/bstansberry/received_events","type":"User","site_admin":false},"body":"This won't work. There are two steps that trigger a call to this method: SyncDomainModelOperationHandler and an inner class of OperationSlaveStepHandler. Neither are the steps that will trigger the context.reloadRequired() above. Therefore AbstractOperationContext.revertReloadRequired() will ignore their attempt to revert the reload required. (This is all part of ensuring that if multiple steps in a composite record reload-required, it's not reverted unless all of them revert it.)","created_at":"2015-09-20T15:03:57Z","updated_at":"2015-09-20T15:03:57Z","html_url":"https://github.com/wildfly/wildfly-core/pull/1085#discussion_r39930736","pull_request_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/1085","_links":{"self":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/comments/39930736"},"html":{"href":"https://github.com/wildfly/wildfly-core/pull/1085#discussion_r39930736"},"pull_request":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/1085"}}},"pull_request":{"url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/1085","id":45494518,"html_url":"https://github.com/wildfly/wildfly-core/pull/1085","diff_url":"https://github.com/wildfly/wildfly-core/pull/1085.diff","patch_url":"https://github.com/wildfly/wildfly-core/pull/1085.patch","issue_url":"https://api.github.com/repos/wildfly/wildfly-core/issues/1085","number":1085,"state":"open","locked":false,"title":"[WFCORE-393] Use a runtime registry on the slave to track if an ignored","user":{"login":"kabir","id":49927,"avatar_url":"https://avatars.githubusercontent.com/u/49927?v=3","gravatar_id":"","url":"https://api.github.com/users/kabir","html_url":"https://github.com/kabir","followers_url":"https://api.github.com/users/kabir/followers","following_url":"https://api.github.com/users/kabir/following{/other_user}","gists_url":"https://api.github.com/users/kabir/gists{/gist_id}","starred_url":"https://api.github.com/users/kabir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kabir/subscriptions","organizations_url":"https://api.github.com/users/kabir/orgs","repos_url":"https://api.github.com/users/kabir/repos","events_url":"https://api.github.com/users/kabir/events{/privacy}","received_events_url":"https://api.github.com/users/kabir/received_events","type":"User","site_admin":false},"body":"profile is being cloned. In this case, the clone operation does not get\r\nexecuted on the slave. Track this, and ignore any subsequent operations\r\non that profile on the slave, and put the slave in the requires-reload\r\nstate.","created_at":"2015-09-20T11:15:37Z","updated_at":"2015-09-20T15:03:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3ceee4348c2fa0336548a174914ff94a207d1db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/1085/commits","review_comments_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/1085/comments","review_comment_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wildfly/wildfly-core/issues/1085/comments","statuses_url":"https://api.github.com/repos/wildfly/wildfly-core/statuses/288ee5e27975345dc3e267ad54aa8cc09655a114","head":{"label":"kabir:profile-clone-transformer-and-ignores","ref":"profile-clone-transformer-and-ignores","sha":"288ee5e27975345dc3e267ad54aa8cc09655a114","user":{"login":"kabir","id":49927,"avatar_url":"https://avatars.githubusercontent.com/u/49927?v=3","gravatar_id":"","url":"https://api.github.com/users/kabir","html_url":"https://github.com/kabir","followers_url":"https://api.github.com/users/kabir/followers","following_url":"https://api.github.com/users/kabir/following{/other_user}","gists_url":"https://api.github.com/users/kabir/gists{/gist_id}","starred_url":"https://api.github.com/users/kabir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kabir/subscriptions","organizations_url":"https://api.github.com/users/kabir/orgs","repos_url":"https://api.github.com/users/kabir/repos","events_url":"https://api.github.com/users/kabir/events{/privacy}","received_events_url":"https://api.github.com/users/kabir/received_events","type":"User","site_admin":false},"repo":{"id":21432484,"name":"wildfly-core","full_name":"kabir/wildfly-core","owner":{"login":"kabir","id":49927,"avatar_url":"https://avatars.githubusercontent.com/u/49927?v=3","gravatar_id":"","url":"https://api.github.com/users/kabir","html_url":"https://github.com/kabir","followers_url":"https://api.github.com/users/kabir/followers","following_url":"https://api.github.com/users/kabir/following{/other_user}","gists_url":"https://api.github.com/users/kabir/gists{/gist_id}","starred_url":"https://api.github.com/users/kabir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kabir/subscriptions","organizations_url":"https://api.github.com/users/kabir/orgs","repos_url":"https://api.github.com/users/kabir/repos","events_url":"https://api.github.com/users/kabir/events{/privacy}","received_events_url":"https://api.github.com/users/kabir/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kabir/wildfly-core","description":"The core runtime that is used by the Wildfly application server","fork":true,"url":"https://api.github.com/repos/kabir/wildfly-core","forks_url":"https://api.github.com/repos/kabir/wildfly-core/forks","keys_url":"https://api.github.com/repos/kabir/wildfly-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kabir/wildfly-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kabir/wildfly-core/teams","hooks_url":"https://api.github.com/repos/kabir/wildfly-core/hooks","issue_events_url":"https://api.github.com/repos/kabir/wildfly-core/issues/events{/number}","events_url":"https://api.github.com/repos/kabir/wildfly-core/events","assignees_url":"https://api.github.com/repos/kabir/wildfly-core/assignees{/user}","branches_url":"https://api.github.com/repos/kabir/wildfly-core/branches{/branch}","tags_url":"https://api.github.com/repos/kabir/wildfly-core/tags","blobs_url":"https://api.github.com/repos/kabir/wildfly-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kabir/wildfly-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kabir/wildfly-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/kabir/wildfly-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kabir/wildfly-core/statuses/{sha}","languages_url":"https://api.github.com/repos/kabir/wildfly-core/languages","stargazers_url":"https://api.github.com/repos/kabir/wildfly-core/stargazers","contributors_url":"https://api.github.com/repos/kabir/wildfly-core/contributors","subscribers_url":"https://api.github.com/repos/kabir/wildfly-core/subscribers","subscription_url":"https://api.github.com/repos/kabir/wildfly-core/subscription","commits_url":"https://api.github.com/repos/kabir/wildfly-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/kabir/wildfly-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/kabir/wildfly-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/kabir/wildfly-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/kabir/wildfly-core/contents/{+path}","compare_url":"https://api.github.com/repos/kabir/wildfly-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kabir/wildfly-core/merges","archive_url":"https://api.github.com/repos/kabir/wildfly-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kabir/wildfly-core/downloads","issues_url":"https://api.github.com/repos/kabir/wildfly-core/issues{/number}","pulls_url":"https://api.github.com/repos/kabir/wildfly-core/pulls{/number}","milestones_url":"https://api.github.com/repos/kabir/wildfly-core/milestones{/number}","notifications_url":"https://api.github.com/repos/kabir/wildfly-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kabir/wildfly-core/labels{/name}","releases_url":"https://api.github.com/repos/kabir/wildfly-core/releases{/id}","created_at":"2014-07-02T17:03:20Z","updated_at":"2015-04-27T22:05:07Z","pushed_at":"2015-09-20T11:15:05Z","git_url":"git://github.com/kabir/wildfly-core.git","ssh_url":"git@github.com:kabir/wildfly-core.git","clone_url":"https://github.com/kabir/wildfly-core.git","svn_url":"https://github.com/kabir/wildfly-core","homepage":null,"size":45802,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wildfly:master","ref":"master","sha":"40be75c1d3b15ff2c47c523cbed61996b0cfeace","user":{"login":"wildfly","id":3066274,"avatar_url":"https://avatars.githubusercontent.com/u/3066274?v=3","gravatar_id":"","url":"https://api.github.com/users/wildfly","html_url":"https://github.com/wildfly","followers_url":"https://api.github.com/users/wildfly/followers","following_url":"https://api.github.com/users/wildfly/following{/other_user}","gists_url":"https://api.github.com/users/wildfly/gists{/gist_id}","starred_url":"https://api.github.com/users/wildfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildfly/subscriptions","organizations_url":"https://api.github.com/users/wildfly/orgs","repos_url":"https://api.github.com/users/wildfly/repos","events_url":"https://api.github.com/users/wildfly/events{/privacy}","received_events_url":"https://api.github.com/users/wildfly/received_events","type":"Organization","site_admin":false},"repo":{"id":21394954,"name":"wildfly-core","full_name":"wildfly/wildfly-core","owner":{"login":"wildfly","id":3066274,"avatar_url":"https://avatars.githubusercontent.com/u/3066274?v=3","gravatar_id":"","url":"https://api.github.com/users/wildfly","html_url":"https://github.com/wildfly","followers_url":"https://api.github.com/users/wildfly/followers","following_url":"https://api.github.com/users/wildfly/following{/other_user}","gists_url":"https://api.github.com/users/wildfly/gists{/gist_id}","starred_url":"https://api.github.com/users/wildfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildfly/subscriptions","organizations_url":"https://api.github.com/users/wildfly/orgs","repos_url":"https://api.github.com/users/wildfly/repos","events_url":"https://api.github.com/users/wildfly/events{/privacy}","received_events_url":"https://api.github.com/users/wildfly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wildfly/wildfly-core","description":"The core runtime that is used by the Wildfly application server","fork":false,"url":"https://api.github.com/repos/wildfly/wildfly-core","forks_url":"https://api.github.com/repos/wildfly/wildfly-core/forks","keys_url":"https://api.github.com/repos/wildfly/wildfly-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wildfly/wildfly-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wildfly/wildfly-core/teams","hooks_url":"https://api.github.com/repos/wildfly/wildfly-core/hooks","issue_events_url":"https://api.github.com/repos/wildfly/wildfly-core/issues/events{/number}","events_url":"https://api.github.com/repos/wildfly/wildfly-core/events","assignees_url":"https://api.github.com/repos/wildfly/wildfly-core/assignees{/user}","branches_url":"https://api.github.com/repos/wildfly/wildfly-core/branches{/branch}","tags_url":"https://api.github.com/repos/wildfly/wildfly-core/tags","blobs_url":"https://api.github.com/repos/wildfly/wildfly-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wildfly/wildfly-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wildfly/wildfly-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/wildfly/wildfly-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wildfly/wildfly-core/statuses/{sha}","languages_url":"https://api.github.com/repos/wildfly/wildfly-core/languages","stargazers_url":"https://api.github.com/repos/wildfly/wildfly-core/stargazers","contributors_url":"https://api.github.com/repos/wildfly/wildfly-core/contributors","subscribers_url":"https://api.github.com/repos/wildfly/wildfly-core/subscribers","subscription_url":"https://api.github.com/repos/wildfly/wildfly-core/subscription","commits_url":"https://api.github.com/repos/wildfly/wildfly-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/wildfly/wildfly-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/wildfly/wildfly-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/wildfly/wildfly-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/wildfly/wildfly-core/contents/{+path}","compare_url":"https://api.github.com/repos/wildfly/wildfly-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wildfly/wildfly-core/merges","archive_url":"https://api.github.com/repos/wildfly/wildfly-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wildfly/wildfly-core/downloads","issues_url":"https://api.github.com/repos/wildfly/wildfly-core/issues{/number}","pulls_url":"https://api.github.com/repos/wildfly/wildfly-core/pulls{/number}","milestones_url":"https://api.github.com/repos/wildfly/wildfly-core/milestones{/number}","notifications_url":"https://api.github.com/repos/wildfly/wildfly-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wildfly/wildfly-core/labels{/name}","releases_url":"https://api.github.com/repos/wildfly/wildfly-core/releases{/id}","created_at":"2014-07-01T16:33:34Z","updated_at":"2015-09-19T16:42:31Z","pushed_at":"2015-09-20T14:20:07Z","git_url":"git://github.com/wildfly/wildfly-core.git","ssh_url":"git@github.com:wildfly/wildfly-core.git","clone_url":"https://github.com/wildfly/wildfly-core.git","svn_url":"https://github.com/wildfly/wildfly-core","homepage":null,"size":80555,"stargazers_count":33,"watchers_count":33,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":152,"mirror_url":null,"open_issues_count":12,"forks":152,"open_issues":12,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/1085"},"html":{"href":"https://github.com/wildfly/wildfly-core/pull/1085"},"issue":{"href":"https://api.github.com/repos/wildfly/wildfly-core/issues/1085"},"comments":{"href":"https://api.github.com/repos/wildfly/wildfly-core/issues/1085/comments"},"review_comments":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/1085/comments"},"review_comment":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wildfly/wildfly-core/pulls/1085/commits"},"statuses":{"href":"https://api.github.com/repos/wildfly/wildfly-core/statuses/288ee5e27975345dc3e267ad54aa8cc09655a114"}}}}