New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
common/Formatter: avoid newline if there is no output #5351
Conversation
Need to add a signed-off-by line to the commit message as outlined in https://github.com/ceph/ceph/blob/master/SubmittingPatches |
@Aran85 I understand that there's an issue. I just think that it seems to me that the issue needs to be fixed in the formatter. I don't think that avoiding a call to flush is the way to go as we'll eventually hit this issue again. |
dear @yehudasa |
dear @yehudasa |
dear @yehudasa |
@Aran85 you should probably also squash the commits together |
dear @yehudasa |
Signed-off-by: Aran85 zhangzengran@h3c.com
dear @yehudasa |
@Aran85 I see why it fixes the original issue, but it seems to me that we break other things in the process. From what I understand is that we now switched to appending eol just in the case where the stack is empty, which means that it will only happen to the top level (or am I misreading?). Also, having to update a test to get this change passing doesn't seem quite right. |
dear @yehudasa |
dear @yehudasa
we could see that the eols at line1 to line5 are common condition.they are dumped by the next line.There are only tow methods which are print_name() and close_section() in the common condithon. the eol at line 6 is dumped by final flush So most of the time the eols in json are not dumped by flush.only the eol at last line is dumped by flush. The reason why i append eol in the case where the stack is empty is to replace the eol which is dumped by final flush. |
I think there are two options: |
hello @liewegas |
common/Formatter: avoid newline if there is no output Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
When executed the gateway command : radosgw-admin mdlog list ,these are some useless blank lines (default is 64 lines) in the output message.this is marked when no meta log in the gateway.
Signed-off-by: Aran85 zhangzengran@h3c.com