Uploaded image for project: 'Hawkular Metrics'
  1. Hawkular Metrics
  2. HWKMETRICS-789

Optimized pod_id query causes NPE in SimpleTagQueryParser

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 0.30.5
    • Fix Version/s: 0.31.0, 0.30.8
    • Component/s: Core
    • Labels:
      None

      Description

      HWKMETRICS-787 introduced an optimization for pod_id queries. Those changes however resulted in a NullPointerException in SimpleTagQueryParser:

      2018-05-23 03:33:13,357 ERROR [org.hawkular.metrics.api.jaxrs.util.ApiUtils] (RxComputationScheduler-3) HAWKMETRICS200010: Failed to process request: java.lang.NullPointerException
              at org.hawkular.metrics.core.service.tags.SimpleTagQueryParser.lambda$tagValueFilter$40(SimpleTagQueryParser.java:557)
              at rx.internal.operators.OnSubscribeFilter$FilterSubscriber.onNext(OnSubscribeFilter.java:67)
              at rx.internal.operators.OnSubscribeFilter$FilterSubscriber.onNext(OnSubscribeFilter.java:76)
              at rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:395)
              at rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:355)
              at rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:846)
              at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onNext(OnSubscribeDoOnEach.java:101)
              at rx.observers.Subscribers$5.onNext(Subscribers.java:235)
              at rx.internal.operators.OnSubscribeSwitchIfEmpty$ParentSubscriber.onNext(OnSubscribeSwitchIfEmpty.java:121)
              at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
              at rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:395)
              at rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:355)
              at rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:846)
              at org.hawkular.rx.cassandra.driver.ResultSetToRowsTransformer$RowProducer.produce(ResultSetToRowsTransformer.java:111)
              at org.hawkular.rx.cassandra.driver.ResultSetToRowsTransformer$RowProducer.lambda$execute$0(ResultSetToRowsTransformer.java:154)
              at rx.internal.schedulers.EventLoopsScheduler$EventLoopWorker$1.call(EventLoopsScheduler.java:172)
              at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: org.hawkular.metrics.model.Metric.class
              at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:118)
              at rx.internal.operators.OnSubscribeFilter$FilterSubscriber.onNext(OnSubscribeFilter.java:71)
              ... 22 more
      

      This prevents graphs from rendering on the metrics overview page in the OpenShift web console.

      The error can easily be reproduced with tags queries such as:

      pod_id:871497e0-16b6-11e8-985b-54e1ad486be8|941497e0-16b6-11e8-985b-54e1ad486ae2,
      descriptor_name:memory/usage|cpu/usage,
      type:pod_container,
      container_name:myservice,
      

      Note that the line breaks are added only to improve readability.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                john.sanda John Sanda
                Reporter:
                john.sanda John Sanda
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: