8000 worker_spi: Initialize bgw_notify_pid in all cases. · postgres/postgres@616afee · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"commit":{"oid":"616afee14d7e8d6690286aaf8a2a0a01168c378a","url":"/postgres/postgres/commit/616afee14d7e8d6690286aaf8a2a0a01168c378a","authoredDate":"2014-05-26T22:56:28.000-04:00","committedDate":"2014-05-26T22:56:28.000-04:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eworker_spi: Initialize bgw_notify_pid in all cases.\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"Commit \u003ca class=\"commit-link\" data-hovercard-type=\"commit\" data-hovercard-url=\"https://github.com/postgres/postgres/commit/090d0f2050647958865cb495dff74af7257d2bb4/hovercard\" href=\"https://github.com/postgres/postgres/commit/090d0f2050647958865cb495dff74af7257d2bb4\"\u003e\u003ctt\u003e090d0f2\u003c/tt\u003e\u003c/a\u003e added new code showing\nhow it can be useful to set bgw_notify_pid to a non-zero value, but it\nfailed to make sure that the existing call to RegisterBackgroundWorker\ninitialized the new field at all.\n\nReport and patch by Shigeru Hanada.","authors":[{"login":"robertmhaas","displayName":"Robert Haas","avatarUrl":"https://avatars.githubusercontent.com/u/886678?v=4","path":"/robertmhaas","isGitHub":false}],"committerAttribution":false,"committer":{"login":"robertmhaas","displayName":"Robert Haas","avatarUrl":"https://avatars.githubusercontent.com/u/886678?v=4","path":"/robertmhaas","isGitHub":false},"parents":["9d7ded0f4277f5c0063eca8e871a34e2355a8371"],"globalRelayId":"MDY6Q29tbWl0OTI3NDQyOjYxNmFmZWUxNGQ3ZThkNjY5MDI4NmFhZjhhMmEwYTAxMTY4YzM3OGE=","sha1":"9d7ded0f4277f5c0063eca8e871a34e2355a8371","sha2":"616afee14d7e8d6690286aaf8a2a0a01168c378a"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":347,"text":"@@ -348,6 +348,7 @@ _PG_init(void)","html":"@@ -348,6 +348,7 @@ _PG_init(void)","displayNoNewLineWarning":false,"position":0,"left":347,"right":347},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":348,"text":" \tworker.bgw_start_time = BgWorkerStart_RecoveryFinished;","html":" \t\u003cspan class=pl-s1\u003eworker\u003c/span\u003e.\u003cspan class=pl-c1\u003ebgw_start_time\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003eBgWorkerStart_RecoveryFinished\u003c/span\u003e;","displayNoNewLineWarning":false,"position":1,"left":348,"right":348},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":349,"text":" \tworker.bgw_restart_time = BGW_NEVER_RESTART;","html":" \t\u003cspan class=pl-s1\u003eworker\u003c/span\u003e.\u003cspan class=pl-c1\u003ebgw_restart_time\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-c1\u003eBGW_NEVER_RESTART\u003c/span\u003e;","displayNoNewLineWarning":false,"position":2,"left":349,"right":349},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":350,"text":" \tworker.bgw_main = worker_spi_main;","html":" \t\u003cspan class=pl-s1\u003eworker\u003c/span\u003e.\u003cspan class=pl-c1\u003ebgw_main\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003eworker_spi_main\u003c/span\u003e;","displayNoNewLineWarning":false,"position":3,"left":350,"right":350},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":351,"text":"+\tworker.bgw_notify_pid = 0;","html":"+\t\u003cspan class=pl-s1\u003eworker\u003c/span\u003e.\u003cspan class=pl-c1\u003ebgw_notify_pid\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e;","displayNoNewLineWarning":false,"position":4,"left":350,"right":351},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":352,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":5,"left":351,"right":352},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":353,"text":" \t/*","html":" \t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":352,"right":353},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":354,"text":" \t * Now fill in worker-specific data, and do the actual registrations.","html":" \u003cspan class=pl-c\u003e\t * Now fill in worker-specific data, and do the actual registrations.\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":353,"right":354}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":407,"linesChanged":1,"newTreeEntry":{"lineCount":407,"path":"contrib/worker_spi/worker_spi.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"contrib/worker_spi/worker_spi.c","mode":100644},"linesAdded":1,"linesDeleted":0,"path":"contrib/worker_spi/worker_spi.c","pathDigest":"d8437ea42d3768a30fb4f085e5792ce74b28f1d737898e044bb3c66552d6fa81","status":"MODIFIED","truncatedReason":null,"oldOid":"9d7ded0f4277f5c0063eca8e871a34e2355a8371","newOid":"616afee14d7e8d6690286aaf8a2a0a01168c378a","copilotChatReference":null,"deletedSha":"9d7ded0f4277f5c0063eca8e871a34e2355a8371","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/616afee14d7e8d6690286aaf8a2a0a01168c378a","fileTreeExpanded":true,"headerInfo":{"additions":1,"deletions":0,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":284,"lineShownCount":8},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"dwOJher8JqqNyO25WceNy-kv4OodxUKzYi3_K0EcyBkiEPmjBkMufJ5xjIGT8oKMCp6wa3ZFrhzkvo7zkeG1LQ"},"/users/diffview?diff=unified":{"post":"0e6BA8P5vcxahlOe9Ug3elmeFV8NTQlgU_fit-mNo2uE_fElL0a1Gkk_MqY_fTg9ui9F3mbN5c_VZJNvOXDeXw"},"/notifications/thread":{"post":"vJxy7vpByQQQNnRFLgWu2u3Zy-RNJTnXpP_Ini5mDZyPCOtkoOYNhpL2oZxVN6p6yUgiDiymeNkn8ZzbvlKt8w"}}},"title":"worker_spi: Initialize bgw_notify_pid in all cases. · postgres/postgres@616afee","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}

Commit 616afee

Browse files
committed
worker_spi: Initialize bgw_notify_pid in all cases.
Commit 090d0f2 added new code showing how it can be useful to set bgw_notify_pid to a non-zero value, but it failed to make sure that the existing call to RegisterBackgroundWorker initialized the new field at all. Report and patch by Shigeru Hanada.
1 parent 9d7ded0 commit 616afee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

contrib/worker_spi/worker_spi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ _PG_init(void)
348348
worker.bgw_start_time = BgWorkerStart_RecoveryFinished;
349349
worker.bgw_restart_time = BGW_NEVER_RESTART;
350350
worker.bgw_main = worker_spi_main;
351+
worker.bgw_notify_pid = 0;
351352

352353
/*
353354
* Now fill in worker-specific data, and do the actual registrations.

0 commit comments

Comments
 (0)
0