[OpenNMS/opennms] 8475ec: NMS-20258: Keep the DataSource across an event tra...

Marshall Massengill via opennms-cvs <[email protected]>
Newsgroups gmane.network.opennms.cvs
Message-ID <OpenNMS/opennms/push/refs/heads/mm/NMS-20258-smoke/[email protected]>
  Branch: refs/heads/mm/NMS-20258-smoke
  Home:   https://github.com/OpenNMS/opennms
  Commit: 8475ec01e2aa94fd10ec1ae879ba3c4538cc5d49
      https://github.com/OpenNMS/opennms/commit/8475ec01e2aa94fd10ec1ae879ba3c4538cc5d49
  Author: Marshall Massengill <[email protected]>
  Date:   2026-08-25 (Tue, 25 Aug 2026)

  Changed paths:
    M opennms-config/src/main/java/org/opennms/netmgt/config/EventTranslatorConfigFactory.java
    A opennms-config/src/test/java/org/opennms/netmgt/config/EventTranslatorConfigReloadTest.java

  Log Message:
  -----------
  NMS-20258: Keep the DataSource across an event translator config reload

EventTranslatorConfigFactory.update() unmarshalled the new configuration
through an overload that passed a null DataSource, so m_dbConnFactory was
cleared on every reload. SqlValueSpec reads that field when it evaluates,
so after the first reloadDaemonConfig for the Translator every mapping
holding a type="sql" value threw

  NullPointerException: Cannot invoke "javax.sql.DataSource.getConnection()"
  because "this.m_db" is null

and stopped translating until OpenNMS was restarted. Mappings without a sql
value kept working, which is why the reload looked successful.

update() was the only caller of the single-argument overload, so it now
passes the DataSource it already holds and the overload is gone.

Reproduced on a live 36.0.4 instance against a translation whose values are
resolved in sql. The shipped translator-configuration.xml resolves ifDescr,
ifName and ifAlias that way, so a reload leaves the default link-down and
link-up translations broken. Present unchanged since 2012 and on every
maintained branch.



To unsubscribe from these emails, change your notification settings at https://github.com/OpenNMS/opennms/settings/notifications


_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/wiki/index.php?page=MailingListFaq
opennms-cvs mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.