From 6fda9871a037fdbac341f55f0b9a175e3977281e Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 25 Oct 2013 16:16:43 -0700 Subject: [PATCH] Mix in the pid in the top 16 bits for the initial xid. This helps for users which rapidly fork a lot of processes that then immediately create a new context (I am looking at you dbench) to awoid having lots of processes starting and using overlapping xid values. --- lib/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/init.c b/lib/init.c index 62a8f81..2a451a1 100644 --- a/lib/init.c +++ b/lib/init.c @@ -70,7 +70,7 @@ struct rpc_context *rpc_init_context(void) free(rpc); return NULL; } - rpc->xid = salt + time(NULL); + rpc->xid = salt + time(NULL) + getpid() << 16; salt += 0x01000000; rpc->fd = -1; -- 2.34.1