-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Active View Maps - LRU Map - Gets Corrupted - Likely Because of Restore View State #3970
Comments
@javaserverfaces Commented |
@javaserverfaces Commented Kindest regards. |
@javaserverfaces Commented Their is a lot of noise in the changes due to formatter differences between my IDE and yours, I expect. To find the relevant changes just search for synchronized (viewMaps) or synchronized (activeViewMaps) as you use both variable names on different occasions to refer the ACTIVE_VIEW_MAPS. Kind regards. |
@javaserverfaces Commented Please consider the changes on commit I await your feedback on the changes. The damaged cause by a corrupted LRU did not only have very bad impact in terms of the application serve health - with a CPU fully committed to run a cleanup cycle of cleaning up beans. There are other ways the issue could have played out depending on what the corrupted Active VIew Maps would look like in memory, as it is horrible to debug . Kindest regards. |
@javaserverfaces Commented |
@javaserverfaces Commented Actually, that has already been done. Kindest regards. |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented I believe, however, that the simplest is to either: And then, on your local working directory, do a Svn Diff, to get an overall idea of the changed code lines. Integrating these changes by hand should be the simplest approach, as there are only two files and only a few code lines affected. Kindest regards. |
@javaserverfaces Commented javax.faces.SERIALIZE_SERVER_STATE |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented Many thanks for the suggestion. So the best fix for such a problem, is from the begining, having a synchronization model that logically insures concurrent threads are not manipulating non-thread-safe objects. Which is what the fix proposes aims to do. Up to you to decide if there is a better approach. In any case, since you recommend this setting, it might be worth while using it. Kindest regards. |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented Concerning OCA, I have already done it. I also thank you for your explanation, the JSF requests belonging to a specific user session are serialized, so that does clarify why the solution would address concurrency issues. For now, then, we have two possible work-arounds for this. We will go with one of the two options. As for the final fix, we await that you guys find the best solution for it, as that is the most important - since we now have more than work-around to chose from. Kindest regards. |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
|
Hi,
I've opened for you an issue on git hub under:
jboss/mojarra#3
In summary, the active View Maps is not thread safe and is not accessed in a thread safe manner leading to LinkedHashMap Corruption.
The problem is described in detail on git hub.
Please review your synchronization whenever you access your LRU maps, in this case the Active View Maps fetched from the Http Session by the contant :
Map<String, Object> viewMaps = (Map<String, Object>) context.getExternalContext().
getSessionMap().get("com.sun.faces.application.view.activeViewMaps");
Whenever you do something like:
viewMaps.get("someID") you run a risk of corrupting the map as it is is not thread safe.
This has lead us to an inifite cycle in the destruction of a JSF server session.
This issue is not only criticla, it is a blocked as it forced a full server restart to get the CPU available again to work due to a dead session.
The issue was detected on 2.1.25 but I've taken a look on github to the 2.1.29 release and the bug seems to be there as well.
Please review as well your synchronization on teh Server Side State holder LRU map, just in case and to be safe of such issues in the future.
Kindest regards,
Nuno.
Environment
windows 7, Oracle Unbreakable Linux 7
Affected Versions
[2.1.25]
The text was updated successfully, but these errors were encountered: