glassfish
  1. glassfish
  2. GLASSFISH-20498

Monitoring: misleading message or failure to register probe misses important data

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0_b88_RC4
    • Fix Version/s: 4.1
    • Component/s: monitoring
    • Labels:
      None

      Description

      See GLASSFISH-19677 - the failed probe registration reports the probe class, not the actual failure:

      WARNING: MNTG0201:Flashlight listener registration failed for listener class : com.sun.ejb.monitoring.stats.StatelessSessionBeanStatsProvider , will retry later

      The actual cause is available only at FINE level:

      FINE: Listener registration failed
      java.lang.RuntimeException: Probe is not yet registered: glassfish:ejb:bean_null_MonTest_TestBean:methodEndEvent

      But the actual probes are registered fine...

        Activity

        Hide
        Terry2013 added a comment -

        Hi Romain , Marina
        I have reproduced the issue on the latest GlssfishV4.
        I investigated a bit of source code , and found the logic in ejb-container is very odd.

        com.sun.ejb.containers.BaseContainer
        protected void createMonitoringRegistry() {
                    //Please disregard the above code
        
                    ejbProbeListener = getMonitoringStatsProvider(appName, modName, ejbName);
                    ejbProbeListener.addMethods(getContainerId(), appName, modName, ejbName, getMonitoringMethodsArray());
                    ejbProbeListener.register();★1
        
                    if (_logger.isLoggable(Level.FINE)) {
        	        _logger.log(Level.FINE, "Created MonitoringRegistry: " + 
                                EjbMonitoringUtils.getDetailedLoggingName(appName, modName, ejbName));
                    }
        	} catch (Exception ex) {
        	    _logger.log(Level.SEVERE, COULD_NOT_CREATE_MONITORREGISTRYMEDIATOR, new Object[]{EjbMonitoringUtils.getDetailedLoggingName(appName, modName, ejbName), ex});
        	}
        
                // Always create to avoid NPE
                try {
                    ProbeProviderFactory probeFactory = ejbContainerUtilImpl.getProbeProviderFactory();
                    String invokerId = EjbMonitoringUtils.getInvokerId(appName, modName, ejbName);
                    ejbProbeNotifier = probeFactory.getProbeProvider(EjbMonitoringProbeProvider.class, invokerId);★2
                    if (_logger.isLoggable(Level.FINE)) {
                        _logger.log(Level.FINE, "Got ProbeProvider: " + ejbProbeNotifier.getClass().getName());
                    }
                } catch (Exception ex) {
                    ejbProbeNotifier = new EjbMonitoringProbeProvider();
                    if (_logger.isLoggable(Level.FINE)) {
                        _logger.log(Level.FINE, "Error getting the EjbMonitoringProbeProvider");
                    }
                }
        
            }
        

        In my understanding , Monitoring in GlassFish V4 need to register ProbeProvider and StatsProvider.
        And StatProvider depend on ProbeProvider.So I think StatProvider's registration need after ProbeProvider's.
        But in ejb container , StatProvider's registration (★1) is before ProbeProvider's(★2).
        So the MNTG0201 message is output .

        By the way,After I change ProbeProvider and ProbeProvider registration order, the MNTG0201 message is not output .

        Show
        Terry2013 added a comment - Hi Romain , Marina I have reproduced the issue on the latest GlssfishV4. I investigated a bit of source code , and found the logic in ejb-container is very odd. com.sun.ejb.containers.BaseContainer protected void createMonitoringRegistry() { //Please disregard the above code ejbProbeListener = getMonitoringStatsProvider(appName, modName, ejbName); ejbProbeListener.addMethods(getContainerId(), appName, modName, ejbName, getMonitoringMethodsArray()); ejbProbeListener.register();★1 if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Created MonitoringRegistry: " + EjbMonitoringUtils.getDetailedLoggingName(appName, modName, ejbName)); } } catch (Exception ex) { _logger.log(Level.SEVERE, COULD_NOT_CREATE_MONITORREGISTRYMEDIATOR, new Object []{EjbMonitoringUtils.getDetailedLoggingName(appName, modName, ejbName), ex}); } // Always create to avoid NPE try { ProbeProviderFactory probeFactory = ejbContainerUtilImpl.getProbeProviderFactory(); String invokerId = EjbMonitoringUtils.getInvokerId(appName, modName, ejbName); ejbProbeNotifier = probeFactory.getProbeProvider(EjbMonitoringProbeProvider.class, invokerId);★2 if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Got ProbeProvider: " + ejbProbeNotifier.getClass().getName()); } } catch (Exception ex) { ejbProbeNotifier = new EjbMonitoringProbeProvider(); if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Error getting the EjbMonitoringProbeProvider" ); } } } In my understanding , Monitoring in GlassFish V4 need to register ProbeProvider and StatsProvider. And StatProvider depend on ProbeProvider.So I think StatProvider's registration need after ProbeProvider's. But in ejb container , StatProvider's registration (★1) is before ProbeProvider's(★2). So the MNTG0201 message is output . By the way,After I change ProbeProvider and ProbeProvider registration order, the MNTG0201 message is not output .
        Hide
        lzg5039 added a comment -

        Hi Romain , Marina ,Terry2013

        there is same probelm in the com.sun.ejb.containers.StatefulSessionContainer.registerMonitorableComponents
        ★2 order to register before ★1

         protected void registerMonitorableComponents() {
                super.registerMonitorableComponents();
                cacheProbeListener = new EjbCacheStatsProvider(sessionBeanCache,
                        getContainerId(), containerInfo.appName, containerInfo.modName,
                        containerInfo.ejbName);
                cacheProbeListener.register();★1
        
                try {
                    ProbeProviderFactory probeFactory = ejbContainerUtilImpl.getProbeProviderFactory();
                    String invokerId = EjbMonitoringUtils.getInvokerId(containerInfo.appName,
                            containerInfo.modName, containerInfo.ejbName);
                    cacheProbeNotifier = probeFactory.getProbeProvider(EjbCacheProbeProvider.class, invokerId);★2
                    if (_logger.isLoggable(Level.FINE)) {
                        _logger.log(Level.FINE, "Got ProbeProvider: " + cacheProbeNotifier.getClass().getName());
                    }
                } catch (Exception ex) {
                    cacheProbeNotifier = new EjbCacheProbeProvider();
                    if (_logger.isLoggable(Level.FINE)) {
                        _logger.log(Level.FINE, "Error getting the EjbMonitoringProbeProvider");
                    }
                }
        
                if (isHAEnabled) {
                    sfsbStoreMonitor = new HAStatefulSessionStoreMonitor();
                } else {
                    sfsbStoreMonitor = new StatefulSessionStoreMonitor();
                }
                sessionBeanCache.setStatefulSessionStoreMonitor(sfsbStoreMonitor);
                _logger.log(Level.FINE, "[SFSBContainer] registered monitorable");
            }
        

        There is an another problem in the org.glassfish.persistence.ejb.entitybean.container.registerMonitorableComponents.
        There is not EjbCacheProbeProvider in the registerMonitorableComponents(),but EjbCacheStatsProvider depends on the EjbCacheProbeProvider .
        So I think it needs to register EjbCacheProbeProvider before ★1.

          protected void registerMonitorableComponents() {
                super.registerMonitorableComponents();
        	if (readyStore != null) {
        	    int confMaxCacheSize = cacheProp.maxCacheSize;
        	    if (confMaxCacheSize <= 0) {
        		confMaxCacheSize = Integer.MAX_VALUE;
        	    }
        	    this.cacheStatsProvider = new EntityCacheStatsProvider(
        		    (BaseCache) readyStore, confMaxCacheSize);
        	    //registryMediator.registerProvider(cacheStatsProvider);
                    cacheProbeListener = new EjbCacheStatsProvider(cacheStatsProvider,
                            getContainerId(), containerInfo.appName, containerInfo.modName,
                            containerInfo.ejbName);
                    cacheProbeListener.register();★1
        	}
                poolProbeListener = new EjbPoolStatsProvider(entityCtxPool, 
                        getContainerId(), containerInfo.appName, containerInfo.modName,
                        containerInfo.ejbName);
                poolProbeListener.register();
                _logger.log(Level.FINE, "[Entity Container] registered monitorable");
            }
        
        
        Show
        lzg5039 added a comment - Hi Romain , Marina ,Terry2013 there is same probelm in the com.sun.ejb.containers.StatefulSessionContainer.registerMonitorableComponents ★2 order to register before ★1 protected void registerMonitorableComponents() { super.registerMonitorableComponents(); cacheProbeListener = new EjbCacheStatsProvider(sessionBeanCache, getContainerId(), containerInfo.appName, containerInfo.modName, containerInfo.ejbName); cacheProbeListener.register();★1 try { ProbeProviderFactory probeFactory = ejbContainerUtilImpl.getProbeProviderFactory(); String invokerId = EjbMonitoringUtils.getInvokerId(containerInfo.appName, containerInfo.modName, containerInfo.ejbName); cacheProbeNotifier = probeFactory.getProbeProvider(EjbCacheProbeProvider.class, invokerId);★2 if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Got ProbeProvider: " + cacheProbeNotifier.getClass().getName()); } } catch (Exception ex) { cacheProbeNotifier = new EjbCacheProbeProvider(); if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Error getting the EjbMonitoringProbeProvider"); } } if (isHAEnabled) { sfsbStoreMonitor = new HAStatefulSessionStoreMonitor(); } else { sfsbStoreMonitor = new StatefulSessionStoreMonitor(); } sessionBeanCache.setStatefulSessionStoreMonitor(sfsbStoreMonitor); _logger.log(Level.FINE, "[SFSBContainer] registered monitorable"); } There is an another problem in the org.glassfish.persistence.ejb.entitybean.container.registerMonitorableComponents. There is not EjbCacheProbeProvider in the registerMonitorableComponents(),but EjbCacheStatsProvider depends on the EjbCacheProbeProvider . So I think it needs to register EjbCacheProbeProvider before ★1. protected void registerMonitorableComponents() { super.registerMonitorableComponents(); if (readyStore != null) { int confMaxCacheSize = cacheProp.maxCacheSize; if (confMaxCacheSize <= 0) { confMaxCacheSize = Integer.MAX_VALUE; } this.cacheStatsProvider = new EntityCacheStatsProvider( (BaseCache) readyStore, confMaxCacheSize); //registryMediator.registerProvider(cacheStatsProvider); cacheProbeListener = new EjbCacheStatsProvider(cacheStatsProvider, getContainerId(), containerInfo.appName, containerInfo.modName, containerInfo.ejbName); cacheProbeListener.register();★1 } poolProbeListener = new EjbPoolStatsProvider(entityCtxPool, getContainerId(), containerInfo.appName, containerInfo.modName, containerInfo.ejbName); poolProbeListener.register(); _logger.log(Level.FINE, "[Entity Container] registered monitorable"); }

          People

          • Assignee:
            Byron Nevins
            Reporter:
            marina vatkina
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: