summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-11-17 13:11:16 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-12-07 08:18:30 -0800
commit4543a68e6eb36355e37988247947494e7bcecb97 (patch)
tree04504bcae684efb7ff9be1f759ecf281f7b1c7cf
parent2173267f4a646ad2edef20a7791719168a9039c7 (diff)
cli: Print to screen frequently
Problem: CLI appears to be hung because XML document is not flushed periodically Fix: Flush the buffer as soon as we print something >BUG: 1395993 >Change-Id: Ic5f61d4c7d29ee162a124a049e60ceb810d6da6d >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> >Reviewed-on: http://review.gluster.org/15863 >Smoke: Gluster Build System <jenkins@build.gluster.org> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> >Reviewed-by: Atin Mukherjee <amukherj@redhat.com> BUG: 1396779 Change-Id: Ie7b4093d54afc7dafc4d1d7c151a9b383cfe3830 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/15885 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
-rw-r--r--heal/src/glfs-heal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index 175816985b2..94cb6b04c02 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -154,6 +154,7 @@ glfsh_xml_init ()
/* <bricks> */
xmlTextWriterStartElement (glfsh_writer,
(xmlChar *)"bricks");
+ xmlTextWriterFlush (glfsh_writer);
xml_out:
return ret;
}
@@ -252,7 +253,9 @@ glfsh_print_xml_heal_op_status (int ret, uint64_t num_entries, char *fmt_str)
"%"PRIu64"", num_entries);
}
out:
- return xmlTextWriterEndElement (glfsh_writer);
+ ret = xmlTextWriterEndElement (glfsh_writer);
+ xmlTextWriterFlush (glfsh_writer);
+ return ret;
}
void
@@ -263,6 +266,7 @@ glfsh_print_xml_file_status (char *path, uuid_t gfid, char *status)
"%s", uuid_utoa (gfid));
xmlTextWriterWriteFormatString (glfsh_writer, "%s", path);
xmlTextWriterEndElement (glfsh_writer);
+ xmlTextWriterFlush (glfsh_writer);
return;
}
@@ -303,6 +307,7 @@ print:
remote_host ? remote_host : "-",
remote_subvol ? remote_subvol : "-");
XML_RET_CHECK_AND_GOTO (x_ret, xml_out);
+ xmlTextWriterFlush (glfsh_writer);
xml_out:
return ret;
}