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

Commitd8f15c9

Browse files
committed
Reduce chatter from signaling of autovacuum workers.
Don't print a WARNING if we get ESRCH from a kill() that's attemptingto cancel an autovacuum worker. It's possible (and has been seen in thebuildfarm) that the worker is already gone by the time we are able toexecute the kill, in which case the failure is harmless. About the onlyplausible reason for reporting such cases would be to help debug corruptedlock table contents, but this is hardly likely to be the most importantsymptom if that happens. Moreover issuing a WARNING might scare usersmore than is warranted.Also, since sending a signal to an autovacuum worker is now entirely aroutine thing, and the worker will log the query cancel on its end anyway,reduce the message saying we're doing that from LOG to DEBUG1 level.Very minor cosmetic cleanup as well.Since the main practical reason for doing this is to avoid unnecessarybuildfarm failures, back-patch to all active branches.
1 parent1e2bd43 commitd8f15c9

File tree

1 file changed

+19
-9
lines changed
  • src/backend/storage/lmgr

1 file changed

+19
-9
lines changed

‎src/backend/storage/lmgr/proc.c

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,22 +1167,32 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
11671167
/* release lock as quickly as possible */
11681168
LWLockRelease(ProcArrayLock);
11691169

1170-
ereport(LOG,
1170+
/* send the autovacuum worker Back to Old Kent Road */
1171+
ereport(DEBUG1,
11711172
(errmsg("sending cancel to blocking autovacuum PID %d",
11721173
pid),
11731174
errdetail_log("%s",logbuf.data)));
11741175

1175-
pfree(logbuf.data);
1176-
pfree(locktagbuf.data);
1177-
1178-
/* send the autovacuum worker Back to Old Kent Road */
11791176
if (kill(pid,SIGINT)<0)
11801177
{
1181-
/* Just a warning to allow multiple callers */
1182-
ereport(WARNING,
1183-
(errmsg("could not send signal to process %d: %m",
1184-
pid)));
1178+
/*
1179+
* There's a race condition here: once we release the
1180+
* ProcArrayLock, it's possible for the autovac worker to
1181+
* close up shop and exit before we can do the kill().
1182+
* Therefore, we do not whinge about no-such-process.
1183+
* Other errors such as EPERM could conceivably happen if
1184+
* the kernel recycles the PID fast enough, but such cases
1185+
* seem improbable enough that it's probably best to issue
1186+
* a warning if we see some other errno.
1187+
*/
1188+
if (errno!=ESRCH)
1189+
ereport(WARNING,
1190+
(errmsg("could not send signal to process %d: %m",
1191+
pid)));
11851192
}
1193+
1194+
pfree(logbuf.data);
1195+
pfree(locktagbuf.data);
11861196
}
11871197
else
11881198
LWLockRelease(ProcArrayLock);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp