ISISComputingGroup / ISISComputingGroup/IBEX

Handle Infinity in the archive engine

オープン
#2,955 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
言語のデータがありません
スター
6
フォーク
2
平均マージ
16時間 40分
マージ済み PR(30日)
2

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, mysql
領域
backend, databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。