06-28-2018, 09:03 PM
Finally, the database errors are gone, puh. After hours of debugging, it worked one time and another time no candles were written into db.
The above error lead me into the direction to introduce a connection pool usage. This will also prevent to have a single, unrecoverable connection inside handle.js and speeds up db usage. If for some reason this connection previously dropped, the process died; a connection pool can handle this.
Second change was to move from the prepared statement for candle upserts into a transactional upsert query.
I will do more testing, but after several --import and realtime runs, there was no candle missing in the db anymore. If you want to take a closer look or merge I can create a pull request.
The above error lead me into the direction to introduce a connection pool usage. This will also prevent to have a single, unrecoverable connection inside handle.js and speeds up db usage. If for some reason this connection previously dropped, the process died; a connection pool can handle this.
Second change was to move from the prepared statement for candle upserts into a transactional upsert query.
I will do more testing, but after several --import and realtime runs, there was no candle missing in the db anymore. If you want to take a closer look or merge I can create a pull request.