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

Commit937b858

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 parentbf7b169 commit937b858

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
@@ -94,11 +94,7 @@ static intpiperead(int s, char *buf, int len);
9494

9595
#else/* !WIN32 */
9696

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

104100
/* Non-Windows implementation of pipe access */
@@ -300,14 +296,6 @@ archive_close_connection(int code, void *arg)
300296
if (si->AHX)
301297
DisconnectDatabase(si->AHX);
302298

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

11871173
if (i<0&&errno==EINTR)
@@ -1278,17 +1264,9 @@ sendMessageToWorker(ParallelState *pstate, int worker, const char *str)
12781264

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp