Issue Details (XML | Word | Printable)

Key: GLASSFISH-20924
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Jennifer Chou
Reporter: Joe Di Pol
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

ConcurrentModificationException in StatsProviderManager.unregister() at startup

Created: 11/Dec/13 06:04 PM   Updated: 16/Dec/13 04:02 PM   Resolved: 16/Dec/13 04:02 PM
Component/s: monitoring
Affects Version/s: 4.0
Fix Version/s: 4.0.1

Time Tracking:
Not Specified

File Attachments: 1. Text File diff.txt (2 kB) 11/Dec/13 06:21 PM - Jennifer Chou
2. Java Source File (5 kB) 11/Dec/13 06:21 PM - Jennifer Chou

Issue Links:

Participants: Jennifer Chou, Joe Di Pol and oleksiys

 Description  « Hide

On large scale GlassFish cluster testing we sometimes see the following exception on GlassFish instance startup resulting in the instance not coming up:

[#|2013-12-04T20:20:41.483+0000|SEVERE|glassfish 4.0|javax.enterprise.system.core|_ThreadID=1;_ThreadName=main;_TimeMillis=1386188441483;_LevelValue=1000;_MessageID=NCLS-CORE-00019;|
  Shutting down server due to startup exception
    at java.util.Vector$Itr.checkForComodification(
    at java.util.Vector$
    at org.glassfish.external.probe.provider.StatsProviderManager.unregister(
    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(
    at org.jvnet.hk2.internal.ClazzCreator.create(
    at org.jvnet.hk2.internal.SystemDescriptor.create(
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(
    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(
    at org.jvnet.hk2.internal.Utilities.createService(
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$

Jennifer Chou added a comment - 11/Dec/13 06:21 PM

Synchronize the methods on StatsProviderManager that update the Vector toBeRegistered: registerStatsProvider, unregister,and setStatsProviderManagerDelegate. Hopefully, performance will not be an issue since these methods are very small.

oleksiys added a comment - 11/Dec/13 09:22 PM

Jennifer, pls. change Vector to ArrayList. The Vector class is thread-safe itself (its methods are synchronized), but as we synchronize StatsProviderManager methods - we don't need extra synchronization.

Jennifer Chou added a comment - 11/Dec/13 10:13 PM

Changed Vector to ArrayList.

Jennifer Chou added a comment - 16/Dec/13 04:02 PM

Integrated management-api-3.2.1-b002 which contains the fix. This should fix the ConcurrentModificationException. If the problem is still seen in the large scale cluster test, please reopen this issue.

r63025 | jc129909 | 2013-12-16 10:52:43 -0500 (Mon, 16 Dec 2013) | 4 lines

Integrate management-api-3.2.1-b002 which contains the fix for GLASSFISH-20924.
Approved by Romain Grecourt.
Passed QL, admin devtests.

Index: pom.xml
— pom.xml (revision 63024)
+++ pom.xml (working copy)
@@ -161,7 +161,7 @@

  • <glassfish-management-api.version>3.2.0-b001</glassfish-management-api.version>
    + <glassfish-management-api.version>3.2.1-b002</glassfish-management-api.version>