Improve error handling and log error context#15
Conversation
|
That seems a systemd error log, note that you can set I am reviewing this PR now, everything seems good but having the commit splitted like in your description would have been better |
|
And sorry for the terrible |
| db.update(&meta, utxo_spent, history_map, utxo_created) | ||
| .inspect_err(|e| log::error!("Error updating store: {e:?}")) | ||
| .map_err(|_| Error::Other)?; // TODO | ||
| state.set_hash_ts(&meta).await; |
There was a problem hiding this comment.
it seems it's called internally in update() also, should we remove it from here?
| let meta = BlockMeta::new(block_height, block.block_hash(), block.header.time); | ||
| state.set_hash_ts(&meta).await; | ||
| db.update(&meta, utxo_spent, history_map, utxo_created) | ||
| .inspect_err(|e| log::error!("Error updating store: {e:?}")) |
There was a problem hiding this comment.
should we use with_context like in other places?
| pub(crate) async fn blocks_infallible( | ||
| shared_state: Arc<State>, | ||
| client: Client, | ||
| shutdown_signal: Receiver<()>, |
There was a problem hiding this comment.
do we need this also in the mempool thread? (not needed in this MR just wondering)
|
Do you discover what was the specific cause of the initial |
We've observed an error in the blocks thread causing the blocks updates to stall because the
indexfn exits:This PR:
indexfn to log the error sourceset_hash_tsfn only after successfully callingdb.updatefnblocks_infalliblefn to handle the error in a loopblocks_infallibleloop