ISISComputingGroup / ISISComputingGroup/IBEX

Handle Infinity in the archive engine

Offen
#2,955 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Keine Sprachdaten
Sterne
6
Forks
2
Ø Merge
16 Std. 40 Min.
Gemergte PRs (30 T.)
2

Beschreibung

If a block has the value "Infinity" then the archive engine throws an exception as this is not valid for MySQL

2018-02-08 13:15:36] 2018-02-08 13:15:36.651 WARNING [Thread 438] org.csstudio.archive.engine.model.WriteThread (run) - Error, will try to reconnect
[2018-02-08 13:15:36] java.sql.SQLException: 'Infinity' is not a valid numeric or approximate numeric value

[2018-02-08 13:15:36] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998)

[2018-02-08 13:15:36] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:937)

[2018-02-08 13:15:36] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)

[2018-02-08 13:15:36] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:872)

[2018-02-08 13:15:36] at com.mysql.jdbc.PreparedStatement.setDouble(PreparedStatement.java:3300)

[2018-02-08 13:15:36] at org.csstudio.archive.writer.rdb.RDBArchiveWriter.batchBlobbedDoubleSample(RDBArchiveWriter.java:320)

[2018-02-08 13:15:36] at org.csstudio.archive.writer.rdb.RDBArchiveWriter.batchDoubleSamples(RDBArchiveWriter.java:295)

[2018-02-08 13:15:36] at org.csstudio.archive.writer.rdb.RDBArchiveWriter.batchSample(RDBArchiveWriter.java:272)

[2018-02-08 13:15:36] at org.csstudio.archive.writer.rdb.RDBArchiveWriter.addSample(RDBArchiveWriter.java:177)

[2018-02-08 13:15:36] at org.csstudio.archive.engine.model.WriteThread.write(WriteThread.java:259)

[2018-02-08 13:15:36] at org.csstudio.archive.engine.model.WriteThread.run(WriteThread.java:182)

[2018-02-08 13:15:36] at java.lang.Thread.run(Unknown Source)

This seemed to lead to some block values not being properly flushed at run start/end when we reload the archive engine. It looks like NaN is Ok as a value, it is not clear if NaN is actually valid in MySQL and as the log value looks to be stored as zero I suspect not. Thus I think the archive engine is trapping NaN already and just needs to trap Infinity too.

It would be worth trapping both "Infinity" and "Inf" as both look to be valid, in theory you can have +Inf and -Inf too...

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.