Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit210981a

Browse files
committed
Remove pg_dump/parallel.c's useless "aborting" flag.
This was effectively dead code, since the places that tested it could notbe reached after we entered the on-exit-cleanup routine that would set it.It seems to have been a leftover from a design in which error abort wouldtry to send fresh commands to the workers --- a design which could neverhave worked reliably, of course. Since the flag is not cross-platform, itcomplicates reasoning about the code's behavior, which we could do without.Although this is effectively just cosmetic, back-patch anyway, becausethere are some actual bugs in the vicinity of this behavior.Discussion: <15583.1464462418@sss.pgh.pa.us>
1 parent6b3094c commit210981a

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

‎src/bin/pg_dump/parallel.c

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ static intpiperead(int s, char *buf, int len);
9595

9696
#else/* !WIN32 */
9797

98-
/*
99-
* Variables for handling signals. aborting is only ever used in the master,
100-
* the workers just need wantAbort.
101-
*/
102-
staticboolaborting= false;
98+
/* Signal handler flag */
10399
staticvolatilesig_atomic_twantAbort=0;
104100

105101
/* Non-Windows implementation of pipe access */
@@ -301,14 +297,6 @@ archive_close_connection(int code, void *arg)
301297
if (si->AHX)
302298
DisconnectDatabase(si->AHX);
303299

304-
#ifndefWIN32
305-
306-
/*
307-
* Setting aborting to true shuts off error/warning messages that
308-
* are no longer useful once we start killing workers.
309-
*/
310-
aborting= true;
311-
#endif
312300
ShutdownWorkersHard(si->pstate);
313301
}
314302
else
@@ -1178,11 +1166,9 @@ select_loop(int maxFd, fd_set *workerset)
11781166
/*
11791167
* If we Ctrl-C the master process, it's likely that we interrupt
11801168
* select() here. The signal handler will set wantAbort == true and
1181-
* the shutdown journey starts from here. Note that we'll come back
1182-
* here later when we tell all workers to terminate and read their
1183-
* responses. But then we have aborting set to true.
1169+
* the shutdown journey starts from here.
11841170
*/
1185-
if (wantAbort&& !aborting)
1171+
if (wantAbort)
11861172
exit_horribly(modulename,"terminated by user\n");
11871173

11881174
if (i<0&&errno==EINTR)
@@ -1279,17 +1265,9 @@ sendMessageToWorker(ParallelState *pstate, int worker, const char *str)
12791265

12801266
if (pipewrite(pstate->parallelSlot[worker].pipeWrite,str,len)!=len)
12811267
{
1282-
/*
1283-
* If we're already aborting anyway, don't care if we succeed or not.
1284-
* The child might have gone already. (XXX but if we're aborting
1285-
* already, why are we here at all?)
1286-
*/
1287-
#ifndefWIN32
1288-
if (!aborting)
1289-
#endif
1290-
exit_horribly(modulename,
1291-
"could not write to the communication channel: %s\n",
1292-
strerror(errno));
1268+
exit_horribly(modulename,
1269+
"could not write to the communication channel: %s\n",
1270+
strerror(errno));
12931271
}
12941272
}
12951273

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp