ISISComputingGroup / ISISComputingGroup/IBEX

Handle Infinity in the archive engine

Aperta
#2,955 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Nessun dato sulla lingua
Stelle
6
Fork
2
Merge medio
16h 40m
PR unite (30g)
2

Descrizione

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...

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.