[
https://issues.jboss.org/browse/GTNPORTAL-1823?page=com.atlassian.jira.pl...
]
Marko Strukelj commented on GTNPORTAL-1823:
-------------------------------------------
I took a look, and here's my analysis:
When a new page is added to the portal by two conversations in parallel, a concurrency
issue ensues, which causes only one page to be added to navigation, even though both pages
are created (this is visible in portal’s navigation if logging in with a fresh session).
Also, at the end of Add New Page wizard one of the conversations often produces an empty
page with an error message: 'This node does not have any pages.'.
There is a test case that can be used to reproduce the issue. The test is based on
HtmlUnit so it doesn’t require UI + Firefox as Selenium tests do, and is therefore quick
to run, and truly cross-platform.
Test is available here:
http://anonsvn.jboss.org/repos/gatein/portal/trunk/testsuite/htmlunit-tests/
To execute:
mvn integration-test -Phtmlunit -Dtest=Test_GTNPORTAL_1823_FailToCreatePage
-Dtest.dumpPageOnFail=true
(The last parameter is optional - @see WebHelper#initFromProps() for all the options).
At the end of Add New Page when Finish button is pressed, action request is performed,
which later makes a redirect to newly created page. Even if we serialize all requests
(i.e. at servlet filter level via synchronized block) only one child node is added to
navigation. That makes me think that the race condition is not a consequence of missing
synchronization blocks, but a result of caching the page navigation and performing the
update by adding the new node to stale navigation and saving that to storage - thereby
overwriting any changes made in between.
A different test where a call to Finish has 5 seconds delay between the two conversations
while they both start at the same time, reveals that both wizard conversations complete
successfully. But each conversation only sees its own page node in the navigation - the
second conversation overwrites the first one’s navigation.
I suspect that occasional page with error message (condition that the above mentioned test
looks for specifically) occurs when the second conversation’s Finish action is performed
right after first conversation’s Finish action, but finishes (and overwrites navigation)
before first conversation’s redirected newly added page is fully rendered (but has already
begun rendering) - meaning that navigation node to which first conversation is redirected
disappears in the middle of processing.
I suggest someone with intimate knowledge of how navigation works (and should work) looks
into this, and provides a proper fix.
Fail to create one page when creating two new pages at the same
time.
---------------------------------------------------------------------
Key: GTNPORTAL-1823
URL:
https://issues.jboss.org/browse/GTNPORTAL-1823
Project: GateIn Portal
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 3.1.0-GA
Reporter: Takayuki Konishi
Assignee: Marko Strukelj
Fail to create one page when creating two new pages at the same time.
And "Page not found" is shown as a result for the failed page.
It seems a timing issue. In plain GateIn, you can reproduce it easily just after starting
GateIn. (In case that WCM have been deployed, you can reproduce it easily at any time.)
This issue can happen with 2 different GateIn users or concurrent accesses by 1 GateIn
user.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira