Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-9835

bsmd: avoid processing alarm lifecycle events when no rules are defined

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 21.0.3, Meridian-2017.1.4
    • Fix Version/s: 21.0.4, Meridian-2017.1.5
    • Component/s: BSM
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon - Jan 24th 2018, Horizon - Feb 1st 2018

      Description

      While analyzing a customer's thread dump, I found the following stack trace:

      "Bsmd-Thread" #324 prio=5 os_prio=0 tid=0x00007f16500f6000 nid=0xa3d runnable [0x00007f156a4b3000]
         java.lang.Thread.State: RUNNABLE
      	at java.net.SocketInputStream.socketRead0(Native Method)
      	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
      	at java.net.SocketInputStream.read(SocketInputStream.java:171)
      	at java.net.SocketInputStream.read(SocketInputStream.java:141)
      	at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:143)
      	at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:112)
      	at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:70)
      	at org.postgresql.core.PGStream.receiveChar(PGStream.java:283)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1919)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291)
      	- locked <0x00000005f3a05ef0> (a org.postgresql.core.v3.QueryExecutorImpl)
      	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432)
      	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358)
      	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:171)
      	at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:119)
      	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
      	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
      	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
      	at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
      	at org.hibernate.loader.Loader.doQuery(Loader.java:802)
      	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
      	at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)
      	at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
      	at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
      	at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3294)
      	at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
      	at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
      	at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
      	at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
      	at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
      	at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
      	at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005)
      	at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)
      	at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:526)
      	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:410)
      	at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:378)
      	at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:518)
      	at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:511)
      	at org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate.get(AbstractDaoHibernate.java:351)
      	at org.opennms.netmgt.bsm.daemon.Bsmd$3.doInTransactionWithoutResult(Bsmd.java:260)
      	at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)
      	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
      	at org.opennms.netmgt.bsm.daemon.Bsmd.handleAlarmCreatedOrUpdated(Bsmd.java:257)
      	at org.opennms.netmgt.bsm.daemon.Bsmd.handleAlarmLifecycleEvents(Bsmd.java:252)
      	at sun.reflect.GeneratedMethodAccessor299.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.opennms.netmgt.events.api.AnnotationBasedEventListenerAdapter.processEvent(AnnotationBasedEventListenerAdapter.java:220)
      	at org.opennms.netmgt.events.api.AnnotationBasedEventListenerAdapter$1.run(AnnotationBasedEventListenerAdapter.java:181)
      	at org.opennms.core.logging.Logging.withPrefix(Logging.java:71)
      	at org.opennms.netmgt.events.api.AnnotationBasedEventListenerAdapter.onEvent(AnnotationBasedEventListenerAdapter.java:174)
      	at org.opennms.netmgt.eventd.EventIpcManagerDefaultImpl$EventListenerExecutor$2.run(EventIpcManagerDefaultImpl.java:183)
      	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.opennms.core.concurrent.LogPreservingThreadFactory$2.run(LogPreservingThreadFactory.java:106)
      	at java.lang.Thread.run(Thread.java:748)
      

      This installation does not have any business rules defined, but bsmd continues to process the alarm lifecycle events and retrieve the associated alarms, which adds unnecessary overhead.

      In order to enhance performance, we should find a way to avoid these lookups when no business rules are defined.

        Attachments

          Activity

            People

            • Assignee:
              j-white Jesse White
              Reporter:
              j-white Jesse White
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: