[ https://issues.apache.org/jira/browse/SLING-4753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14560581#comment-14560581 ]
ASF GitHub Bot commented on SLING-4753: --------------------------------------- GitHub user agrajm opened a pull request: https://github.com/apache/sling/pull/92 SLING-4753 - Commit the Resource Resolver before passing it to TenantCustomizers for setting up their own customizations Persisting the Tenant Resource by calling commit before setting up the Tenant Customizers and passing the resolver to them, which potentially have the ability to undo all the un-committed changes on the Resolver ( including the Tenant Resource itself ) leading to all kind of weird errors like InvalidItemStateException , StaleItemStateException etc. You can merge this pull request into a Git repository by running: $ git pull https://github.com/agrajm/sling trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/sling/pull/92.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #92 ---- commit 2979825d40644e0c51c0e10c47b3139d181a7c19 Author: Agraj Mangal <aman...@adobe.com> Date: 2015-05-27T07:42:04Z SLING-4753 - Commit the Resource Resolver before passing it to Tenant Customizers for setting up their own customizations commit 375f29b74a3ca5b3ba718a9899b902863660cc7a Author: Agraj Mangal <aman...@adobe.com> Date: 2015-05-27T07:53:23Z Revert "SLING-4753 - Commit the Resource Resolver before passing it to Tenant Customizers for setting up their own customizations" This reverts commit 2979825d40644e0c51c0e10c47b3139d181a7c19. commit fe537e9fed86fb022110f72982938ce8f7c7de75 Author: Agraj Mangal <aman...@adobe.com> Date: 2015-05-27T07:54:23Z SLING-4753 - Commit the Resource Resolver before passing it to Tenant Customizers for setting up their own customizations ---- > Commit the Resource Resolver before passing it to Tenant Customizers for > setting up their own customizations > ------------------------------------------------------------------------------------------------------------ > > Key: SLING-4753 > URL: https://issues.apache.org/jira/browse/SLING-4753 > Project: Sling > Issue Type: Bug > Components: Extensions > Affects Versions: Tenant 1.0.4 > Reporter: Agraj Mangal > > We should commit the Resource Resolver after creating the Tenant Resource and > before passing it on to the Tenant Customizers. > One possible issue is that one of the Tenant Customizers calls some APIs like > PageManager##createPage that does a session.refresh() and rollbacks all the > un-committed changes on the resolver so far. That could also include the > tenant resource itself. > Ideally the TenantCustomizers should not call commit on the resolver and let > TenantProvider commit the changes, but it would be a good protection against > all such cases where we could prevent the tenant resource from getting > modified if the TenantCustomizer failed and tried to refresh the session. > We are experiencing this issue in > https://jira.corp.adobe.com/browse/MAC-25410 -- This message was sent by Atlassian JIRA (v6.3.4#6332)