kruize / autotune

Autonomous Performance Tuning for Kubernetes!
Apache License 2.0
165 stars 54 forks source link

Applying a valid layer config after applying a layer config with blank-layer-presence-label-name fails by throwing NullPointerException #271

Open shruacha1234 opened 3 years ago

shruacha1234 commented 3 years ago

Applying a valid layer config after applying a layer config with blank-layer-presence-label-name fails by throwing NullPointerException.

Applying layer config with blank-layer-presence-label-name throws NullPointerException https://github.com/kruize/autotune/issues/149. Now if we apply a valid layer config it creates the object but along with NullPointerException.

Steps to recreate:

blank-layer-presence-label-name yaml

apiVersion: "recommender.com/v1"
kind: "AutotuneConfig"
metadata:
  name: "blank-layer-presence-label-name"
layer_name: quarkus
layer_level: 2
details: quarkus tunables
layerPresence:
  label:
  - name: ' '
    value: quarkus
tunables:
- name: quarkus.thread-pool.core-threads
  description: 'The core thread pool size. This number of threads will always be kept alive.'
  value_type: integer
  upper_bound: "10"
  lower_bound: "1"
  sla_class:
  - response_time
  - throughput
- name: quarkus.thread-pool.queue-size
  description: 'The queue size'
  value_type: integer
  upper_bound: "100"
  lower_bound: "1"
  sla_class:
  - response_time
  - throughput
  - resource_usage
- name: quarkus.hibernate-orm.jdbc.statement-fetch-size
  description: 'How many rows are fetched at a time by the JDBC driver.'
  value_type: integer
  upper_bound: "50"
  lower_bound: "1"
  sla_class:
  - response_time
  - throughput
  - resource_usage

autotune.log

chandrams commented 3 years ago

Applying blank layer presence label name results in NPE as seen below and applying valid yaml after that fails with io.fabric8.kubernetes.client.dsl.internal.RawWatchConnectionManager - Current reconnect backoff is 1000 milliseconds (T0)

07:44:47.885 [OkHttp https://10.96.0.1/...] WARN  io.fabric8.kubernetes.client.dsl.internal.RawWatchConnectionManager - Exec Failure
java.lang.NullPointerException: null
        at com.autotune.analyzer.deployment.AutotuneDeployment.addLayerInfo(AutotuneDeployment.java:563) ~[autotune-0.0.1.jar:?]
        at com.autotune.analyzer.deployment.AutotuneDeployment$2.eventReceived(AutotuneDeployment.java:131) ~[autotune-0.0.1.jar:?]
        at com.autotune.analyzer.deployment.AutotuneDeployment$2.eventReceived(AutotuneDeployment.java:120) ~[autotune-0.0.1.jar:?]
        at io.fabric8.kubernetes.client.dsl.internal.RawWatchConnectionManager$1.onMessage(RawWatchConnectionManager.java:133) [kubernetes-client-4.13.0.jar:?]
        at okhttp3.internal.ws.RealWebSocket.onReadMessage(RealWebSocket.java:323) ~[okhttp-3.12.12.jar:?]
        at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:219) ~[okhttp-3.12.12.jar:?]
        at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:105) ~[okhttp-3.12.12.jar:?]
        at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:274) [okhttp-3.12.12.jar:?]
        at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:214) [okhttp-3.12.12.jar:?]
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203) [okhttp-3.12.12.jar:?]
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) [okhttp-3.12.12.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
        at java.lang.Thread.run(Unknown Source) [?:?]
07:44:47.885 [OkHttp https://10.96.0.1/...] DEBUG io.fabric8.kubernetes.client.dsl.internal.RawWatchConnectionManager - Submitting reconnect task to the executor
07:44:47.885 [scheduleReconnect|Executor for Watch 1867267844] DEBUG io.fabric8.kubernetes.client.dsl.internal.RawWatchConnectionManager - Scheduling reconnect task
07:44:47.885 [scheduleReconnect|Executor for Watch 1867267844] DEBUG io.fabric8.kubernetes.client.dsl.internal.RawWatchConnectionManager - Current reconnect backoff is 1000 milliseconds (T0)