Nice, fio left me a note - and it breaks json parsing #2061
-
|
Hi, Line 1931 in 1a04e57 Is there a reason why this note about capping the number of queues is prepended to and outside of the json output? Qt's Wouldn't it be possible to integrate the note into the json structure instead? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
|
This is a longstanding issue. The main impediment is that See this recent issue #2048 and similar ones linked within. |
Beta Was this translation helpful? Give feedback.
-
|
On Friday February 20 2026 16:03:57 Vincent Kang Fu wrote:
This is a longstanding issue.
I searched ... but only in the discussions section :-/
The main impediment is that `log_info()` is used for these messages as well as for the JSON output, so I don't see an easy fix.
Does it generate the json itself, or does it otherwise know that json output has been requested? That seems like a minimum requirement here, to start addressing the issue.
One easy fix would be to send the notes to stderr (but without exiting with an error code if that doesn't already happen).
If that breaks any code invoking fio it'll probably be easier to work around than pre-processing the json output; I see that my case was still simple!
A bit more involved: if it is known that json output should be generated, ensure that this output can be done in the appropriate fashion (`"note" : "message",`) and that the json document is opened first.
|
Beta Was this translation helpful? Give feedback.
-
|
On Saturday February 21 2026 03:18:25 Sitsofe Wheeler wrote:
For this work to be complete said person would also have to find and convert all the bare `printf`s (or their equivalent) sites that display warnings/errors and convert them to `log_info()`/`log_error()`.
That sounds like the more involved part ... esp. if the equivalents include "alienOS"-specific calls.
I'll have a look at the discussions at an appropriate moment.
But so the problem goes beyond just the generation of "note:" output? Integrating those into the json output should be less work as the sites should be easier to find (and probably fewer), and opening the json container should be as simple as making sure the fio version and other header info is output before any other output can be generated.
Which reminds me: that is the case for the regular output format, which kind of begs the question why the order is different for json output?
Again _someone_ would "just" need to sit down and create the patches.
If you ask me, someone would also have to sit down and write a CMake configure script (or any equivalent) if not only because that makes it easier to import the entire project into an IDE with "intellisense" features.
|
Beta Was this translation helpful? Give feedback.
-
|
On Saturday February 21 2026 08:33:59 Sitsofe Wheeler wrote:
>Adding an extra key to the existing JSON output doesn't seem straightforward. Basically there's no pre-existing thread-safe function to build up a variable length structure that would be set at any point and only consumed (and presumably freed) when the JSON output is produced
Ahhh, the JSON is build up internally and not output on the fly. Yes, that doesn't make things easier, and would explain why the "note:" statements appear ahead of the JSON...
My experience with JSON is strictly in treating it as a key-value dictionary where one doesn't have to care about keys on doesn't (want to) know about - as long as they don't interfere with the structure of course.
Vincent is correct to say that error/warning messages breaking fio's JSON output is a known issue and you're not the first to encounter it. Don't feel it has to be you to slay this dragon but at this point it's kinder all round if we save deciding how easy fixing this is until after the patches that address it are in.
So either way, a list will have to be made of the locations that will need some kind of modification. How about not just labelling them in the code, but addressing them one by one with a temporary workaround that solves the problem by dumping the error or warning to stderr? Not ideal from a project management point of view, but at least people will be able to use the product as intended while the discussions about a true and proper fix continue to go back and forth behind their backs ;)
|
Beta Was this translation helpful? Give feedback.
-
|
I'll leave that to the project to decide.
Evidently. Whenever that'll be...
|
Beta Was this translation helpful? Give feedback.
This is a longstanding issue.
The main impediment is that
log_info()is used for these messages as well as for the JSON output, so I don't see an easy fix.See this recent issue #2048 and similar ones linked within.