ISISComputingGroup / ISISComputingGroup/IBEX

Handle Infinity in the archive engine

Abierto
#2,955 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Sin datos de lenguaje
Estrellas
6
Forks
2
Merge medio
16 h 40 min
PR fusionados (30 d)
2

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start in RDBArchiveWriter, especially batchBlobbedDoubleSample and the surrounding batchDoubleSamples path named in the stack trace. Inspect how NaN is handled, then verify handling for Infinity, Inf, +Inf, and -Inf without the MySQL exception. Done means archive writes continue and block values are flushed correctly at engine start and end.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java, mysql
Área
backend, databases
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.