IntersectMBO / IntersectMBO/ouroboros-network
Cardano-ping output incorrect JSON when it fails to connect
- Dominant language
- Haskell
- Stars
- 296
- Forks
- 104
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 4
Description
As discussed in this [cardano-cli issue](https://github.com/IntersectMBO/cardano-cli/issues/1210), the `cardano-cli ping` command only outputs `] }` when it fails to run with `-j` flag.
It seems the issue comes from [this code](https://github.com/input-output-hk/ouroboros-network/blob/8d9a99fe88c96446586af47abd0ca59fb63d1b80/cardano-ping/src/Cardano/Network/Ping.hs#L114), when there's no `LogMsg` emitted and only a `LogEnd` received.
It seems to me it would be more robust to:
1. provide more "domain specific" logging messages containing the needed information
2. output one JSON object per `LogMsg` per line
I am happy to provide a patch for this but not sure if I am not missing something?
In any case, it would be great if we could avoid outputting those spurious endings.
Contributor guide
Assessment
This issue has not been assessed yet.