Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-1241

NullpointerException due to optional value for commitTime

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.9.5.Final
    • 0.9.3.Final, 0.9.4.Final
    • core-library
    • None

      We are getting NullpointerException after upgrading to 0.9.3.Final from 0.8.3.Final.

      stack:

      unexpected exception while streaming logical changes: java.lang.NullPointerException
      	at io.debezium.time.Conversions.toEpochMicros(Conversions.java:239)
      	at io.debezium.connector.postgresql.SourceInfo.update(SourceInfo.java:199)
      	at io.debezium.connector.postgresql.RecordsStreamProducer.process(RecordsStreamProducer.java:252)
      	at io.debezium.connector.postgresql.RecordsStreamProducer.lambda$streamChanges$1(RecordsStreamProducer.java:134)
      	at io.debezium.connector.postgresql.connection.wal2json.StreamingWal2JsonMessageDecoder.doProcessMessage(StreamingWal2JsonMessageDecoder.java:242)
      	at io.debezium.connector.postgresql.connection.wal2json.StreamingWal2JsonMessageDecoder.nonInitialChunk(StreamingWal2JsonMessageDecoder.java:178)
      	at io.debezium.connector.postgresql.connection.wal2json.StreamingWal2JsonMessageDecoder.processMessage(StreamingWal2JsonMessageDecoder.java:159)
      	at io.debezium.connector.postgresql.connection.PostgresReplicationConnection$1.deserializeMessages(PostgresReplicationConnection.java:269)
      	at io.debezium.connector.postgresql.connection.PostgresReplicationConnection$1.read(PostgresReplicationConnection.java:254)
      	at io.debezium.connector.postgresql.RecordsStreamProducer.streamChanges(RecordsStreamProducer.java:134)
      	at io.debezium.connector.postgresql.RecordsStreamProducer.lambda$start$0(RecordsStreamProducer.java:120)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      Commit: 2ea87727cfbbac792495c47bf7c0fac19420cc1c seems to be the cause.

      Reading the comment of the method `update` of SourceInfo.java

      * @param commitTime the commit time (in microseconds since epoch) of the transaction that generated the event;
      * may be null indicating that this information is not available
      

      So `commitTime` may contain the value `null` while the new code `Conversions.toEpochMicros(commitTime)` can't handle this case.

            Unassigned Unassigned
            jork19 Jork Zijlstra (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: