chg: downgrade "failed to read channel" from abortmsg to debugmsg
authorJun Wu <quark@fb.com>
Mon, 14 Mar 2016 23:28:14 +0000
changeset 28551 8e5312f8df30
parent 28550 e2b9145e35d8
child 28552 999e1acc61aa
chg: downgrade "failed to read channel" from abortmsg to debugmsg If the server has an uncaught exception, it will exit without being able to write the channel information. In this case, the client is likely to complain about "failed to read channel", which looks inconsistent with original hg. This patch silences the error message and makes uncaught exception behavior more like original hg. It will help chg to pass test-fileset.t.
contrib/chg/hgclient.c
--- a/contrib/chg/hgclient.c	Tue Mar 15 00:42:33 2016 +0000
+++ b/contrib/chg/hgclient.c	Mon Mar 14 23:28:14 2016 +0000
@@ -106,8 +106,11 @@
 	assert(hgc);
 
 	ssize_t rsize = recv(hgc->sockfd, &hgc->ctx.ch, sizeof(hgc->ctx.ch), 0);
-	if (rsize != sizeof(hgc->ctx.ch))
-		abortmsg("failed to read channel");
+	if (rsize != sizeof(hgc->ctx.ch)) {
+		/* server would have exception and traceback would be printed */
+		debugmsg("failed to read channel");
+		exit(255);
+	}
 
 	uint32_t datasize_n;
 	rsize = recv(hgc->sockfd, &datasize_n, sizeof(datasize_n), 0);