eclipse-ee4j / glassfish-shoal

Shoal
Other
5 stars 9 forks source link

Sometimes FailureRecoverySignal is not notified #100

Closed glassfishrobot closed 14 years ago

glassfishrobot commented 14 years ago

When I tested FailureRecovery with GroupLeadershipNotification, I found sometimes the signal was not notified.

For FailureRecovery, an appropriate recoverer should be selected for FailureRecovery. But sometimes the recoverer was null when I debugged because of wrong previousView in com.sun.enterprise.ee.cms.impl.jxta.ViewWindow.java.

The com.sun.enterprise.ee.cms.impl.common.ViewWindow interface has following methods and com.sun.enterprise.ee.cms.impl.jxta.ViewWindow.java implements those.

public interface ViewWindow { List getPreviousView(); List getCurrentView(); ... }

But com.sun.enterprise.ee.cms.impl.jxta.ViewWindow.java returns un-safe lists.

See the following code.

In ViewWindow.java — public List getPreviousView() { List result = EMPTRY_GMS_MEMBER_LIST; synchronized(views) { final int INDEX = views.size() -2; if(INDEX >= 0)

{ // views.get(INDEX) is a List and can be shared unexpectedly. result = views.get(INDEX); }

} return result; } ... private void addGroupLeadershipNotificationSignal( ... ) { ... signals.add( new GroupLeadershipNotificationSignalImpl( token, getPreviousView(), getCurrentView(), ...); } —

In GroupLeadershipNotificationSignalImpl.java — public void release() throws SignalReleaseException { if( previousView != null ) previousView.clear(); if( currentView != null ) currentView.clear(); ... } —

As you see above, sometimes the view(previous or current view) could be shared and cleared unexpectedly by other components.

Joe proposed the patch which ensures that all future manipulations of a view snapshot are read-only. After the view snapshot is constructed, all future manipulations are read-only and this change enforces that. And I also removed "List.clear()" code in GroupLeadershipNotificationSignalImpl.java because I think the logic is unnecessary.

Environment

Operating System: All Platform: All

Affected Versions

[current]

glassfishrobot commented 6 years ago
glassfishrobot commented 14 years ago

@glassfishrobot Commented Reported by carryel

glassfishrobot commented 14 years ago

@glassfishrobot Commented carryel said: This patch is applied to trunk/rev.825

glassfishrobot commented 14 years ago

@glassfishrobot Commented Was assigned to carryel

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA SHOAL-100

glassfishrobot commented 14 years ago

@glassfishrobot Commented Marked as fixed on Wednesday, June 23rd 2010, 4:11:06 am