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

Elasticsearch event forwarder manipulates in-flight event

    XMLWordPrintable

    Details

    • Sprint:
      Horizon 2019 - November 20th, Horizon 2019 - November 27th

      Description

      A user reported that linkDown events were being translated with "Unknown" placeholders even when the expected entities existed in the database. While debugging this problem we found that the event received by the event translator daemon did not have any of the event parameters set even though these we confirmed to be present by the event generated by trapd.

       

      After setting the event parameter list to be immutable for these events we encountered the following exception:

      2019-11-07T12:50:43,255 | ERROR | EventToIndex-Thread-28 | EventToIndex                     | 393 - org.opennms.features.opennms-es-rest - 25.1.0 | Unexpected exception during task completion: java.lang.UnsupportedOperationException
      java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
              at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) [?:?]
              at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) [?:?]
              at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) [?:?]
              at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) [?:?]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
              at java.lang.Thread.run(Thread.java:834) [?:?]
      Caused by: java.lang.UnsupportedOperationException
              at java.util.Collections$UnmodifiableCollection.removeAll(Collections.java:1073) ~[?:?]
              at org.opennms.plugins.elasticsearch.rest.EventToIndex.handleParameters(EventToIndex.java:325) ~[?:?]
              at org.opennms.plugins.elasticsearch.rest.EventToIndex.createEventIndexFromEvent(EventToIndex.java:270) ~[?:?]
              at org.opennms.plugins.elasticsearch.rest.EventToIndex.convertEventsToEsActions(EventToIndex.java:211) ~[?:?]
              at org.opennms.plugins.elasticsearch.rest.EventToIndex.lambda$sendEvents$1(EventToIndex.java:173) ~[?:?]
              at org.opennms.features.jest.client.bulk.BulkRequest.createBulk(BulkRequest.java:128) ~[?:?]
              at org.opennms.features.jest.client.bulk.BulkRequest.executeRequest(BulkRequest.java:109) ~[?:?]
              at org.opennms.features.jest.client.bulk.BulkRequest.execute(BulkRequest.java:65) ~[?:?]
              at org.opennms.plugins.elasticsearch.rest.EventToIndex.sendEvents(EventToIndex.java:176) ~[?:?]
              at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714) ~[?:?]
              ... 4 more 

      Which indicates that the ES event forwarder actually modifies the original event.

      When this is done, any daemon that has registered for the event, but not yet processed it will handle an invalid event.

      Modifications like these should be made to a copy of the event or maintained in a separate data structure.

        Attachments

          Activity

            People

            • Assignee:
              ranger Benjamin Reed
              Reporter:
              j-white Jesse White
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: