Skip to content

Commit d2c797c

Browse files
committed
Add artificial delay in DTMD
1 parent f39bac5 commit d2c797c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

contrib/multimaster/dtmd/src/server.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,6 @@ static bool stream_flush(stream_t stream) {
171171
/* nothing to do */
172172
return true;
173173
}
174-
{
175-
struct timespec ts;
176-
int rc;
177-
ts.tv_sec = 0;
178-
ts.tv_nsec = 100000; /* 100usec */
179-
while (nanosleep(&ts, &ts) < 0);
180-
}
181174
char *cursor = stream->output.data;
182175
while (tosend > 0) {
183176
/* repeat sending until we send everything */

contrib/multimaster/libdtm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <unistd.h>
77
#include <stdlib.h>
88
#include <assert.h>
9+
#include <time.h>
910

1011
#include "libdtm.h"
1112
#include "dtmd/include/proto.h"
@@ -168,6 +169,12 @@ static int dtm_recv_results(DTMConn dtm, int maxlen, xid_t *results)
168169
elog(ERROR, "The message body will not fit into the results array");
169170
return 0;
170171
}
172+
{
173+
struct timespec ts;
174+
ts.tv_sec = 0;
175+
ts.tv_nsec = 100000; /* 100usec */
176+
while (nanosleep(&ts, &ts) < 0);
177+
}
171178
while (recved < needed)
172179
{
173180
int newbytes = read(dtm->sock, (char*)results + recved, needed - recved);

0 commit comments

Comments
 (0)